Ghost/core/server
Hannah Wolfe b06f03b370 New fully-loaded & validated activeTheme concept (#8146)
📡 Add debug for the 3 theme activation methods
There are 3 different ways that a theme can be activated in Ghost:

A. On boot: we load the active theme from the file system, according to the `activeTheme` setting
B. On API "activate": when an /activate/ request is triggered for a theme, we validate & change the `activeTheme` setting
C. On API "override": if uploading a theme with the same name, we override. Using a dirty hack to make this work.

A: setting is done, should load & validate + next request does mounting
B: load is done, should validate & change setting + next request does mounting
C: load, validate & setting are all done + a hack is needed to ensure the next request does mounting

 Validate w/ gscan when theme activating on boot
- use the new gscan validation validate.check() method when activating on boot

 New concept of active theme
- add ActiveTheme class
- make it possible to set a theme to be active, and to get the active theme
- call the new themes.activate() method in all 3 cases where we activate a theme

🎨 Use new activeTheme to simplify theme code
- make use of the new concept where we can, to reduce & simplify code
- use new hasPartials() method so we don't have to do file lookups
- use path & name getters to reduce use of getContentPath etc
- remove requirement on req.app.get('activeTheme') from static-theme middleware (more on this soon)

🚨 Improve theme unit tests (TODO: fix inter-dep)
- The theme unit tests are borked! They all pass because they don't test the right things.
- This improves them, but they are still dependent on each-other
- configHbsForContext tests don't pass if the activateTheme tests aren't run first
- I will fix this in a later PR
2017-03-13 21:13:17 +01:00
..
admin 🐛 fix usages of logError (#8138) 2017-03-13 19:47:09 +00:00
api New fully-loaded & validated activeTheme concept (#8146) 2017-03-13 21:13:17 +01:00
apps 🎨 Ghost bootstrap: optimise requires (#8121) 2017-03-13 20:07:12 +00:00
auth 🎨 Ghost bootstrap: optimise requires (#8121) 2017-03-13 20:07:12 +00:00
blog 🎨 🐛 Improve theme lib, middleware & error handling (#8145) 2017-03-13 17:30:35 +01:00
config 🎨 fix admin and theme caching issues (#8058) 2017-03-02 18:18:21 +01:00
controllers/frontend 🔥 No more availableThemes (#8085) 2017-03-02 17:53:48 +01:00
data Themes API activation permissions & validation (#8104) 2017-03-13 12:44:44 +01:00
events post-scheduling 2016-06-14 10:52:13 +02:00
helpers 🎨 Move settings cache & cleanup settings API (#8057) 2017-02-27 16:53:04 +01:00
mail 🎨 Ghost bootstrap: optimise requires (#8121) 2017-03-13 20:07:12 +00:00
middleware New fully-loaded & validated activeTheme concept (#8146) 2017-03-13 21:13:17 +01:00
models suspend user feature (#8114) 2017-03-13 12:03:26 +00:00
permissions 🐛 fix invite permissions for editor (#7889) 2017-01-25 12:07:31 +00:00
scheduling Shows help message for broken require in scheduler adapter (#7706) 2017-01-16 21:49:41 +01:00
settings 🔥 🎨 No more updateSettingsCache (#8090) 2017-03-02 23:00:01 +01:00
storage 🔥 remove imageRelPath (#7927) 2017-02-03 14:42:05 +00:00
themes New fully-loaded & validated activeTheme concept (#8146) 2017-03-13 21:13:17 +01:00
translations suspend user feature (#8114) 2017-03-13 12:03:26 +00:00
utils 🎨 Ghost bootstrap: optimise requires (#8121) 2017-03-13 20:07:12 +00:00
views Switch to new native system font stack (#7219) 2016-08-18 20:29:46 +01:00
app.js 🎨 logging improvements (#7597) 2016-10-25 12:17:43 +01:00
errors.js 🛠 use Ignition for logging/errors (#7869) 2017-01-23 11:04:01 +00:00
filters.js Misc grunt /dev updates 2015-05-28 20:25:14 +01:00
ghost-server.js Theme loading part 1 (#7989) 2017-02-22 00:26:19 +01:00
i18n.js improvement: general fixes 2016-06-01 07:07:20 +02:00
index.js 🎨 deny auto switch (#8086) 2017-03-02 19:50:58 +00:00
logging.js 🐛 forward missing logging config: rotation 2017-02-17 18:24:14 +01:00
overrides.js 🛠 update lodash,knex and bookshelf to latest versions 2016-09-26 10:20:55 +02:00
update-check.js 🎨 send LTS parameter if requesting the update check service (#7954) 2017-02-07 19:51:19 +01:00