mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Moved labs utlity to shared
- This isn't really a "service" - it's a set of utilities for working with labs flags - It's also required all over the place, and doesn't require anything that isn't shared - Therefore, it should live in shared
This commit is contained in:
parent
6fb8736560
commit
782de52678
@ -47,7 +47,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
// Labs utils for enabling/disabling helpers
|
||||
labs: require('../../server/services/labs'),
|
||||
labs: require('../../shared/labs'),
|
||||
|
||||
// Things required from data/meta
|
||||
metaData: require('../meta'),
|
||||
|
@ -5,7 +5,7 @@ const {api} = require('../proxy');
|
||||
const errors = require('@tryghost/errors');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const settingsCache = require('../../../shared/settings-cache');
|
||||
const labs = require('../../../server/services/labs');
|
||||
const labs = require('../../../shared/labs');
|
||||
const activeTheme = require('./active');
|
||||
const preview = require('./preview');
|
||||
|
||||
|
@ -5,7 +5,7 @@ const moment = require('moment-timezone');
|
||||
const errors = require('@tryghost/errors');
|
||||
const models = require('../../models');
|
||||
const membersService = require('../../services/members');
|
||||
const labsService = require('../../services/labs');
|
||||
const labsService = require('../../../shared/labs');
|
||||
|
||||
const settingsCache = require('../../../shared/settings-cache');
|
||||
const i18n = require('../../../shared/i18n');
|
||||
|
@ -2,7 +2,7 @@ const _ = require('lodash');
|
||||
const url = require('./utils/url');
|
||||
const typeGroupMapper = require('../../../../shared/serializers/input/utils/settings-filter-type-group-mapper');
|
||||
const settingsCache = require('../../../../../../shared/settings-cache');
|
||||
const {WRITABLE_KEYS_ALLOWLIST} = require('../../../../../services/labs');
|
||||
const {WRITABLE_KEYS_ALLOWLIST} = require('../../../../../../shared/labs');
|
||||
|
||||
const DEPRECATED_SETTINGS = [
|
||||
'bulk_email_settings',
|
||||
|
@ -1,6 +1,6 @@
|
||||
const _ = require('lodash');
|
||||
const localUtils = require('../../../index');
|
||||
const labsService = require('../../../../../../services/labs');
|
||||
const labsService = require('../../../../../../../shared/labs');
|
||||
|
||||
const tag = (attrs, frame) => {
|
||||
if (localUtils.isContentAPI(frame)) {
|
||||
|
@ -7,7 +7,7 @@ const models = require('../../../../models');
|
||||
const defaultSettings = require('../../../schema').defaultSettings;
|
||||
const keyGroupMapper = require('../../../../api/shared/serializers/input/utils/settings-key-group-mapper');
|
||||
const keyTypeMapper = require('../../../../api/shared/serializers/input/utils/settings-key-type-mapper');
|
||||
const {WRITABLE_KEYS_ALLOWLIST} = require('../../../../services/labs');
|
||||
const {WRITABLE_KEYS_ALLOWLIST} = require('../../../../../shared/labs');
|
||||
|
||||
const labsDefaults = JSON.parse(defaultSettings.labs.labs.defaultValue);
|
||||
const ignoredSettings = ['slack_url', 'members_from_address', 'members_support_address'];
|
||||
|
@ -9,7 +9,7 @@ const i18n = require('../../shared/i18n');
|
||||
const errors = require('@tryghost/errors');
|
||||
const validator = require('@tryghost/validator');
|
||||
const urlUtils = require('../../shared/url-utils');
|
||||
const {WRITABLE_KEYS_ALLOWLIST} = require('../services/labs');
|
||||
const {WRITABLE_KEYS_ALLOWLIST} = require('../../shared/labs');
|
||||
|
||||
const internalContext = {context: {internal: true}};
|
||||
let Settings;
|
||||
|
@ -17,7 +17,7 @@ const db = require('../../data/db');
|
||||
const models = require('../../models');
|
||||
const postEmailSerializer = require('./post-email-serializer');
|
||||
const {getSegmentsFromHtml} = require('./segment-parser');
|
||||
const labs = require('../labs');
|
||||
const labs = require('../../../shared/labs');
|
||||
|
||||
// Used to listen to email.added and email.edited model events originally, I think to offload this - ideally would just use jobs now if possible
|
||||
const events = require('../../lib/common/events');
|
||||
|
@ -7,7 +7,7 @@ const urlUtils = require('../../../../shared/url-utils');
|
||||
const db = require('../../../data/db');
|
||||
const emailTemplate = require('./email-template');
|
||||
const jobsService = require('../../jobs');
|
||||
const labsService = require('../../labs');
|
||||
const labsService = require('../../../../shared/labs');
|
||||
|
||||
const ghostMailer = new GhostMailer();
|
||||
module.exports = class MembersCSVImporter {
|
||||
|
@ -5,7 +5,7 @@ const urlUtils = require('../../../shared/url-utils');
|
||||
const ghostVersion = require('@tryghost/version');
|
||||
const settingsCache = require('../../../shared/settings-cache');
|
||||
const {formattedMemberResponse} = require('./utils');
|
||||
const labsService = require('../labs');
|
||||
const labsService = require('../../../shared/labs');
|
||||
const config = require('../../../shared/config');
|
||||
|
||||
// @TODO: This piece of middleware actually belongs to the frontend, not to the member app
|
||||
|
@ -1,6 +1,6 @@
|
||||
const {isPlainObject} = require('lodash');
|
||||
const config = require('../../../shared/config');
|
||||
const labs = require('../labs');
|
||||
const labs = require('../../../shared/labs');
|
||||
const ghostVersion = require('@tryghost/version');
|
||||
|
||||
module.exports = function getConfigProperties() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const labsUtil = require('../../../services/labs');
|
||||
const labsUtil = require('../../../../shared/labs');
|
||||
|
||||
const labs = flag => (req, res, next) => {
|
||||
if (labsUtil.isSet(flag) === true) {
|
||||
|
@ -5,8 +5,8 @@ const errors = require('@tryghost/errors');
|
||||
const logging = require('@tryghost/logging');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
|
||||
const settingsCache = require('../../shared/settings-cache');
|
||||
const config = require('../../shared/config');
|
||||
const settingsCache = require('./settings-cache');
|
||||
const config = require('./config');
|
||||
|
||||
const messages = {
|
||||
errorMessage: 'The \\{\\{{helperName}\\}\\} helper is not available.',
|
@ -5,7 +5,7 @@ const sinon = require('sinon');
|
||||
const testUtils = require('../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const config = require('../../../core/shared/config');
|
||||
const labs = require('../../../core/server/services/labs');
|
||||
const labs = require('../../../core/shared/labs');
|
||||
const Papa = require('papaparse');
|
||||
const moment = require('moment-timezone');
|
||||
|
||||
|
@ -6,7 +6,7 @@ const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const config = require('../../../../../core/shared/config');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
const mailService = require('../../../../../core/server/services/mail');
|
||||
|
||||
const ghost = testUtils.startGhost;
|
||||
|
@ -5,7 +5,7 @@ const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const config = require('../../../../../core/shared/config');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
|
||||
const ghost = testUtils.startGhost;
|
||||
|
||||
|
@ -3,7 +3,7 @@ const sinon = require('sinon');
|
||||
const moment = require('moment');
|
||||
const supertest = require('supertest');
|
||||
const _ = require('lodash');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
const testUtils = require('../../../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
|
@ -5,7 +5,7 @@ const moment = require('moment');
|
||||
const supertest = require('supertest');
|
||||
const _ = require('lodash');
|
||||
const cheerio = require('cheerio');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
const testUtils = require('../../../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
|
@ -6,7 +6,7 @@ const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const config = require('../../../../../core/shared/config');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
const mailService = require('../../../../../core/server/services/mail');
|
||||
|
||||
const ghost = testUtils.startGhost;
|
||||
|
@ -5,7 +5,7 @@ const sinon = require('sinon');
|
||||
const testUtils = require('../../../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const config = require('../../../../../core/shared/config');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
|
||||
const ghost = testUtils.startGhost;
|
||||
|
||||
|
@ -3,7 +3,7 @@ const sinon = require('sinon');
|
||||
const moment = require('moment');
|
||||
const supertest = require('supertest');
|
||||
const _ = require('lodash');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
const testUtils = require('../../../../utils');
|
||||
const localUtils = require('./utils');
|
||||
const configUtils = require('../../../../utils/configUtils');
|
||||
|
@ -2,7 +2,7 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const hbs = require('../../../core/frontend/services/theme-engine/engine');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const labs = require('../../../core/server/services/labs');
|
||||
const labs = require('../../../core/shared/labs');
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
|
||||
describe('{{cancel_link}} helper', function () {
|
||||
|
@ -2,7 +2,7 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const helpers = require('../../../core/frontend/helpers');
|
||||
const labs = require('../../../core/server/services/labs');
|
||||
const labs = require('../../../core/shared/labs');
|
||||
const handlebars = require('../../../core/frontend/services/theme-engine/engine').handlebars;
|
||||
|
||||
describe('Match helper', function () {
|
||||
|
@ -2,7 +2,7 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
|
||||
const configUtils = require('../../utils/configUtils');
|
||||
const labs = require('../../../core/server/services/labs');
|
||||
const labs = require('../../../core/shared/labs');
|
||||
const settingsCache = require('../../../core/shared/settings-cache');
|
||||
|
||||
describe('Labs Service', function () {
|
||||
|
@ -3,7 +3,7 @@ const sinon = require('sinon');
|
||||
const _ = require('lodash');
|
||||
const testUtils = require('../../../../utils');
|
||||
const helpers = require('../../../../../core/frontend/services/routing/helpers');
|
||||
const labs = require('../../../../../core/server/services/labs');
|
||||
const labs = require('../../../../../core/shared/labs');
|
||||
|
||||
describe('Contexts', function () {
|
||||
let req;
|
||||
|
@ -14,7 +14,7 @@ const fixtureUtils = require('../../core/server/data/schema/fixtures/utils');
|
||||
const emailAnalyticsService = require('../../core/server/services/email-analytics');
|
||||
const permissions = require('../../core/server/services/permissions');
|
||||
const settingsService = require('../../core/server/services/settings');
|
||||
const labsService = require('../../core/server/services/labs');
|
||||
const labsService = require('../../core/shared/labs');
|
||||
|
||||
// Other Test Utilities
|
||||
const context = require('./fixtures/context');
|
||||
|
Loading…
Reference in New Issue
Block a user