Skip to content

Commit 481e242

Browse files
committed
✨ Finalised new boot process
- This commit removes the old boot process and any files that are no longer needed as a result - Remove the duplicate event for triggering inactive themes to load - Tidied up a few other bits
1 parent 9e93ed7 commit 481e242

File tree

12 files changed

+16
-403
lines changed

12 files changed

+16
-403
lines changed

core/boot.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ async function bootGhost() {
208208
debug('End: Load sentry');
209209

210210
debug('Begin: load server + minimal app');
211-
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
212211

213212
// Get minimal application in maintenance mode
214213
const rootApp = require('./app');
@@ -241,7 +240,7 @@ async function bootGhost() {
241240
mountGhost(rootApp, ghostApp);
242241

243242
// Announce Server Readiness
244-
logging.info('Ghost boot', (Date.now() - startTime) / 1000 + 's');
243+
logging.info('Ghost booted', (Date.now() - startTime) / 1000 + 's');
245244
debug('boot announcing readiness');
246245
GhostServer.announceServerReadiness();
247246

core/frontend/services/themes/index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ module.exports = {
2323

2424
debug('init themes', activeThemeName);
2525

26-
// Register a listener for server-start to load all themes
27-
events.on('server.start', function readAllThemesOnServerStart() {
28-
themeLoader.loadAllThemes();
29-
});
30-
events.on('themes.ready', function readAllThemesOnServerStart() {
26+
// Register a listener for when the server says we can start to load all themes
27+
events.on('themes.ready', function readAllThemesOnReady() {
3128
themeLoader.loadAllThemes();
3229
});
3330

core/index.js

-26
This file was deleted.

core/server/data/db/migrator.js

-74
This file was deleted.

core/server/ghost-server.js

-9
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,6 @@ class GhostServer {
199199
}
200200
}
201201

202-
/**
203-
* @param {Object} externalApp - express app instance
204-
* @return {Promise} Resolves once Ghost has switched HTTP Servers
205-
*/
206-
async swapHttpApp(externalApp) {
207-
await this._stopServer();
208-
await this.start(externalApp);
209-
}
210-
211202
/**
212203
* ### Hammertime
213204
* To be called after `stop`

core/server/index.js

-203
This file was deleted.

core/server/web/maintenance/index.js

-6
This file was deleted.

ghost.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
const argv = process.argv;
1+
/**
2+
* Internal CLI Placeholder
3+
*
4+
* If we want to add alternative commands, flags, or modify environment vars, it should all go here.
5+
* Important: This file should not contain any requires, unless we decide to add pretty-cli/commander type tools
6+
*
7+
**/
8+
9+
// Don't allow NODE_ENV to be null
10+
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
211

3-
const mode = argv[2] || 'new';
12+
const argv = process.argv;
13+
const mode = argv[2];
414

515
// Switch between boot modes
616
switch (mode) {
7-
case 'old':
8-
case '3':
9-
// Old boot sequence
10-
require('./startup');
11-
break;
1217
default:
1318
// New boot sequence
1419
require('./core/boot')();

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"@tryghost/kg-markdown-html-renderer": "4.0.0-rc.2",
5757
"@tryghost/kg-mobiledoc-html-renderer": "4.0.0-rc.1",
5858
"@tryghost/magic-link": "0.6.6",
59-
"@tryghost/maintenance": "0.1.0",
6059
"@tryghost/members-api": "1.0.0-rc.3",
6160
"@tryghost/members-csv": "0.4.4",
6261
"@tryghost/members-ssr": "0.8.10",

0 commit comments

Comments
 (0)