mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Moved hbs engine into new theme engine service
- This is the beginning of splitting up the theme service into: - Storage components used by the API (should be a server service) - Theme engine & rendering components used by the frontend (this new engine service) - The code to activate a theme which is shared code where the API & frontend need to communicate - This is needed because currently the frontend theme service is required and used by the API, creating tight coupling. - In my quest to truly separate the API and frontend, this is one of many battles that needs winning
This commit is contained in:
parent
08fbcf1d90
commit
bf0823c9a2
21 changed files with 21 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
const config = require('../../shared/config');
|
||||
const escapeExpression = require('../services/themes/engine').escapeExpression;
|
||||
const escapeExpression = require('../services/theme-engine/engine').escapeExpression;
|
||||
const socialUrls = require('@tryghost/social-urls');
|
||||
const _ = require('lodash');
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This file defines everything that helpers "require"
|
||||
// With the exception of modules like lodash, Bluebird
|
||||
// We can later refactor to enforce this something like we did in apps
|
||||
const hbs = require('./themes/engine');
|
||||
const hbs = require('./theme-engine/engine');
|
||||
const errors = require('@tryghost/errors');
|
||||
|
||||
const {i18n} = require('../../server/lib/common');
|
||||
|
|
|
@ -17,7 +17,7 @@ const _ = require('lodash');
|
|||
const themeConfig = require('./config');
|
||||
const themeEngines = require('./engines');
|
||||
const config = require('../../../shared/config');
|
||||
const engine = require('./engine');
|
||||
const engine = require('../theme-engine/engine');
|
||||
|
||||
// Current instance of ActiveTheme
|
||||
let currentActiveTheme;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const Promise = require('bluebird');
|
||||
const errors = require('@tryghost/errors');
|
||||
const hbs = require('../engine');
|
||||
const hbs = require('../../theme-engine/engine');
|
||||
const config = require('../../../../shared/config');
|
||||
const logging = require('../../../../shared/logging');
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
const templates = {};
|
||||
const _ = require('lodash');
|
||||
const errors = require('@tryghost/errors');
|
||||
const hbs = require('../engine');
|
||||
const hbs = require('../../theme-engine/engine');
|
||||
const {i18n} = require('../../../../server/lib/common');
|
||||
|
||||
// Execute a template helper
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const _ = require('lodash');
|
||||
const hbs = require('./engine');
|
||||
const hbs = require('../theme-engine/engine');
|
||||
const urlUtils = require('../../../shared/url-utils');
|
||||
const config = require('../../../shared/config');
|
||||
const {i18n} = require('../proxy');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const _ = require('lodash');
|
||||
const Promise = require('bluebird');
|
||||
const SafeString = require('../../frontend/services/themes/engine').SafeString;
|
||||
const SafeString = require('../../frontend/services/theme-engine/engine').SafeString;
|
||||
const errors = require('@tryghost/errors');
|
||||
const {i18n} = require('../lib/common');
|
||||
const logging = require('../../shared/logging');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const hbs = require('../../../core/frontend/services/themes/engine');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const labs = require('../../../core/server/services/labs');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const handlebars = require('../../../core/frontend/services/themes/engine').handlebars;
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const should = require('should');
|
||||
const hbs = require('../../../core/frontend/services/themes/engine');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const path = require('path');
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ const should = require('should');
|
|||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const handlebars = require('../../../core/frontend/services/themes/engine').handlebars;
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
describe('{{#foreach}} helper', function () {
|
||||
let options;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const handlebars = require('../../../core/frontend/services/themes/engine').handlebars;
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const handlebars = require('../../../core/frontend/services/themes/engine').handlebars;
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
const should = require('should');
|
||||
const hbs = require('../../../core/frontend/services/themes/engine');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const path = require('path');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const handlebars = require('../../../core/frontend/services/themes/engine').handlebars;
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
const runHelper = data => helpers.navigation.call({}, data);
|
||||
const runHelperThunk = data => () => runHelper(data);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const should = require('should');
|
||||
const hbs = require('../../../core/frontend/services/themes/engine');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const path = require('path');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const handlebars = require('../../../core/frontend/services/themes/engine').handlebars;
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
function compile(templateString) {
|
||||
const template = handlebars.compile(templateString);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const handlebars = require('../../../core/frontend/services/themes/engine').handlebars;
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
let defaultGlobals;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ const config = require('../../../../core/shared/config');
|
|||
// is only exposed via themes.getActive()
|
||||
const activeTheme = require('../../../../core/frontend/services/themes/active');
|
||||
|
||||
const engine = require('../../../../core/frontend/services/themes/engine');
|
||||
const engine = require('../../../../core/frontend/services/theme-engine/engine');
|
||||
|
||||
describe('Themes', function () {
|
||||
afterEach(function () {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const _ = require('lodash');
|
||||
const hbs = require('../../../../../core/frontend/services/themes/engine');
|
||||
const hbs = require('../../../../../core/frontend/services/theme-engine/engine');
|
||||
|
||||
// Stuff we are testing
|
||||
const helpers = require('../../../../../core/frontend/helpers');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const hbs = require('../../../../core/frontend/services/themes/engine');
|
||||
const hbs = require('../../../../core/frontend/services/theme-engine/engine');
|
||||
const themes = require('../../../../core/frontend/services/themes');
|
||||
// is only exposed via themes.getActive()
|
||||
const activeTheme = require('../../../../core/frontend/services/themes/active');
|
||||
|
|
Loading…
Add table
Reference in a new issue