mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Moved theme service to core/server
refs:bf0823c9a2
refs:ae86254972
- continuing the work of splitting up the theme service into logical components Themes Service - The serverside theme service now serves just the API and boot - It loads the theme and passes it to the theme-engine via the bridge This achieves the bare minimum goal of removing all the cross requires between server and frontend around themes There is still a lot more to do to achieve an ideal architecture here as laid out inae86254972
This commit is contained in:
parent
b128cebcb0
commit
bc75fab663
17 changed files with 19 additions and 19 deletions
|
@ -107,7 +107,7 @@ async function initFrontend() {
|
|||
debug('End: Frontend Settings');
|
||||
|
||||
debug('Begin: Themes');
|
||||
const themeService = require('./frontend/services/themes');
|
||||
const themeService = require('./server/services/themes');
|
||||
await themeService.init();
|
||||
debug('End: Themes');
|
||||
|
||||
|
@ -206,7 +206,7 @@ async function initBackgroundServices({config}) {
|
|||
}
|
||||
|
||||
// Load all inactive themes
|
||||
const themeService = require('./frontend/services/themes');
|
||||
const themeService = require('./server/services/themes');
|
||||
themeService.loadInactiveThemes();
|
||||
|
||||
debug('End: initBackgroundServices');
|
||||
|
|
|
@ -3,7 +3,7 @@ const os = require('os');
|
|||
const path = require('path');
|
||||
const security = require('@tryghost/security');
|
||||
const {events} = require('../../lib/common');
|
||||
const themeService = require('../../../frontend/services/themes');
|
||||
const themeService = require('../../services/themes');
|
||||
const limitService = require('../../services/limits');
|
||||
const models = require('../../models');
|
||||
const request = require('../../lib/request');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const {events} = require('../../lib/common');
|
||||
const themeService = require('../../../frontend/services/themes');
|
||||
const themeService = require('../../services/themes');
|
||||
const limitService = require('../../services/limits');
|
||||
const models = require('../../models');
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const {events} = require('../../lib/common');
|
||||
const themeService = require('../../../frontend/services/themes');
|
||||
const themeService = require('../../services/themes');
|
||||
const limitService = require('../../services/limits');
|
||||
const models = require('../../models');
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const path = require('path');
|
|||
const config = require('../../../shared/config');
|
||||
const security = require('@tryghost/security');
|
||||
const {compress} = require('@tryghost/zip');
|
||||
const LocalFileStorage = require('../../../server/adapters/storage/LocalFileStorage');
|
||||
const LocalFileStorage = require('../../adapters/storage/LocalFileStorage');
|
||||
|
||||
/**
|
||||
* @TODO: combine with loader.js?
|
|
@ -7,7 +7,7 @@ const themeLoader = require('./loader');
|
|||
const bridge = require('../../../bridge');
|
||||
const validate = require('./validate');
|
||||
const list = require('./list');
|
||||
const settingsCache = require('../../../server/services/settings/cache');
|
||||
const settingsCache = require('../settings/cache');
|
||||
|
||||
module.exports = {
|
||||
// Init themes module
|
|
@ -1,6 +1,6 @@
|
|||
const debug = require('ghost-ignition').debug('themes:loader');
|
||||
const config = require('../../../shared/config');
|
||||
const packageJSON = require('../../../server/lib/fs/package-json');
|
||||
const packageJSON = require('../../lib/fs/package-json');
|
||||
const themeList = require('./list');
|
||||
|
||||
const loadAllThemes = function loadAllThemes() {
|
|
@ -7,7 +7,7 @@ const ThemeStorage = require('./ThemeStorage');
|
|||
const themeLoader = require('./loader');
|
||||
const toJSON = require('./to-json');
|
||||
|
||||
const settingsCache = require('../../../server/services/settings/cache');
|
||||
const settingsCache = require('../settings/cache');
|
||||
const {i18n} = require('../../../server/lib/common');
|
||||
const logging = require('../../../shared/logging');
|
||||
const errors = require('@tryghost/errors');
|
|
@ -1,8 +1,8 @@
|
|||
const _ = require('lodash');
|
||||
const themeList = require('./list');
|
||||
const bridge = require('../../../bridge');
|
||||
const packageJSON = require('../../../server/lib/fs/package-json');
|
||||
const settingsCache = require('../../../server/services/settings/cache');
|
||||
const packageJSON = require('../../lib/fs/package-json');
|
||||
const settingsCache = require('../settings/cache');
|
||||
|
||||
/**
|
||||
*
|
|
@ -2,7 +2,7 @@ const _ = require('lodash');
|
|||
const Promise = require('bluebird');
|
||||
const fs = require('fs-extra');
|
||||
const config = require('../../../shared/config');
|
||||
const {i18n} = require('../../../server/lib/common');
|
||||
const {i18n} = require('../../lib/common');
|
||||
const errors = require('@tryghost/errors');
|
||||
|
||||
const canActivate = function canActivate(checkedTheme) {
|
|
@ -1,5 +1,5 @@
|
|||
const should = require('should');
|
||||
const themeList = require('../../../core/frontend/services/themes/list');
|
||||
const themeList = require('../../../core/server/services/themes/list');
|
||||
|
||||
// Stuff we are testing
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const themeList = require('../../../../core/frontend/services/themes/list');
|
||||
const themeList = require('../../../../core/server/services/themes/list');
|
||||
|
||||
describe('Themes', function () {
|
||||
afterEach(function () {
|
||||
|
|
|
@ -4,8 +4,8 @@ const fs = require('fs-extra');
|
|||
const tmp = require('tmp');
|
||||
const join = require('path').join;
|
||||
const config = require('../../../../core/shared/config');
|
||||
const loader = require('../../../../core/frontend/services/themes/loader');
|
||||
const themeList = require('../../../../core/frontend/services/themes/list');
|
||||
const loader = require('../../../../core/server/services/themes/loader');
|
||||
const themeList = require('../../../../core/server/services/themes/list');
|
||||
|
||||
describe('Themes', function () {
|
||||
afterEach(function () {
|
||||
|
|
|
@ -2,7 +2,7 @@ const should = require('should');
|
|||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
|
||||
const validate = require('../../../../core/frontend/services/themes/validate');
|
||||
const validate = require('../../../../core/server/services/themes/validate');
|
||||
|
||||
const gscan = require('gscan');
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ const settingsService = require('../../core/server/services/settings');
|
|||
const frontendSettingsService = require('../../core/frontend/services/settings');
|
||||
const settingsCache = require('../../core/server/services/settings/cache');
|
||||
const web = require('../../core/server/web');
|
||||
const themeService = require('../../core/frontend/services/themes');
|
||||
const themeService = require('../../core/server/services/themes');
|
||||
const limits = require('../../core/server/services/limits');
|
||||
|
||||
// Other Test Utilities
|
||||
|
|
|
@ -7,7 +7,7 @@ const routingService = require('../../core/frontend/services/routing');
|
|||
const settingsService = require('../../core/server/services/settings');
|
||||
const settingsCache = require('../../core/server/services/settings/cache');
|
||||
const imageLib = require('../../core/server/lib/image');
|
||||
const themeService = require('../../core/frontend/services/themes');
|
||||
const themeService = require('../../core/server/services/themes');
|
||||
|
||||
// Other Test Utilities
|
||||
const configUtils = require('./configUtils');
|
||||
|
|
Loading…
Reference in a new issue