Skip to content

Commit

Permalink
Replaced ghost-version.js with @tryghost/version
Browse files Browse the repository at this point in the history
no issue
Part of the effort to break up the Ghost codebase into smaller, decoupled modules.
  • Loading branch information
sam-lord committed Jun 16, 2021
1 parent 8ea577b commit 24332c3
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 111 deletions.
2 changes: 1 addition & 1 deletion MigratorConfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const config = require('./core/shared/config');
const ghostVersion = require('./core/server/lib/ghost-version');
const ghostVersion = require('@tryghost/version');

/**
* knex-migrator can be used via CLI or within the application
Expand Down
2 changes: 1 addition & 1 deletion core/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async function bootGhost() {
// Version is required by sentry & Migration config & so is fundamental to booting
// However, it involves reading package.json so its slow & it's here for visibility on that slowness
debug('Begin: Load version info');
require('./server/lib/ghost-version');
require('@tryghost/version');
debug('End: Load version info');

// Sentry must be initialised early, but requires config
Expand Down
2 changes: 1 addition & 1 deletion core/server/data/exporter/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const _ = require('lodash');
const Promise = require('bluebird');
const db = require('../../data/db');
const commands = require('../schema').commands;
const ghostVersion = require('../../lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const i18n = require('../../../shared/i18n');
const errors = require('@tryghost/errors');

Expand Down
27 changes: 0 additions & 27 deletions core/server/lib/ghost-version.js

This file was deleted.

2 changes: 1 addition & 1 deletion core/server/lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const got = require('got');
const _ = require('lodash');
const validator = require('@tryghost/validator');
const errors = require('@tryghost/errors');
const ghostVersion = require('./ghost-version');
const ghostVersion = require('@tryghost/version');

const defaultOptions = {
headers: {
Expand Down
2 changes: 1 addition & 1 deletion core/server/services/members/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const _ = require('lodash');
const logging = require('@tryghost/logging');
const membersService = require('./service');
const urlUtils = require('../../../shared/url-utils');
const ghostVersion = require('../../lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const settingsCache = require('../settings/cache');
const {formattedMemberResponse} = require('./utils');
const labsService = require('../labs');
Expand Down
2 changes: 1 addition & 1 deletion core/server/services/members/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const logging = require('@tryghost/logging');
const urlUtils = require('../../../shared/url-utils');
const settingsCache = require('../settings/cache');
const config = require('../../../shared/config');
const ghostVersion = require('../../lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const _ = require('lodash');

const membersConfig = new MembersConfigProvider({
Expand Down
2 changes: 1 addition & 1 deletion core/server/services/notifications/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const settingsCache = require('../settings/cache');
const i18n = require('../../../shared/i18n');
const ghostVersion = require('../../lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const Notifications = require('./notifications');

module.exports.notifications = new Notifications({settingsCache, i18n, ghostVersion});
2 changes: 1 addition & 1 deletion core/server/services/public-config/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {isPlainObject} = require('lodash');
const config = require('../../../shared/config');
const labs = require('../labs');
const ghostVersion = require('../../lib/ghost-version');
const ghostVersion = require('@tryghost/version');

module.exports = function getConfigProperties() {
const configProperties = {
Expand Down
2 changes: 1 addition & 1 deletion core/server/services/public-config/site.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ghostVersion = require('../../lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const settingsCache = require('../settings/cache');
const config = require('../../../shared/config');
const urlUtils = require('../../../shared/url-utils');
Expand Down
2 changes: 1 addition & 1 deletion core/server/update-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const urlUtils = require('./../shared/url-utils');
const i18n = require('../shared/i18n');
const logging = require('@tryghost/logging');
const request = require('./lib/request');
const ghostVersion = require('./lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const UpdateCheckService = require('@tryghost/update-check-service');

const ghostMailer = new GhostMailer();
Expand Down
2 changes: 1 addition & 1 deletion core/server/web/parent/middleware/ghost-locals.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ghostVersion = require('../../../lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const bridge = require('../../../../bridge');

// ### GhostLocals Middleware
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"@tryghost/update-check-service": "0.1.0",
"@tryghost/url-utils": "1.1.4",
"@tryghost/validator": "0.1.0",
"@tryghost/version": "0.1.0",
"@tryghost/vhost-middleware": "1.0.15",
"@tryghost/zip": "1.1.14",
"amperize": "0.6.1",
Expand Down
2 changes: 1 addition & 1 deletion test/regression/exporter/exporter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const sinon = require('sinon');
const testUtils = require('../../utils');
const _ = require('lodash');

const ghostVersion = require('../../../core/server/lib/ghost-version');
const ghostVersion = require('@tryghost/version');
const {exportedBodyLatest} = require('../../utils/fixtures/export/body-generator');

// Stuff we are testing
Expand Down
72 changes: 0 additions & 72 deletions test/unit/lib/ghost-version_spec.js

This file was deleted.

8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,14 @@
moment-timezone "0.5.23"
validator "7.2.0"

"@tryghost/version@0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@tryghost/version/-/version-0.1.0.tgz#2d1ec5dd19206a5f7ec0f283588fa716980c666c"
integrity sha512-7IvYLn0IFRFNK61IeHLMHb1cPDbD/zfRMlJqUe9kLTFRlLG6D29390VnkXWHC/W+K4frXdP1kfAglXXfOsunmg==
dependencies:
"@tryghost/root-utils" "^0.3.0"
semver "^7.3.5"

"@tryghost/vhost-middleware@1.0.15":
version "1.0.15"
resolved "https://registry.yarnpkg.com/@tryghost/vhost-middleware/-/vhost-middleware-1.0.15.tgz#6f5e7e018fe6d9b09b0f2b7f5294f8133398cbd1"
Expand Down

0 comments on commit 24332c3

Please sign in to comment.