Skip to content

Commit 052422b

Browse files
committed
Moved @tryghost/post-events to core folder
fix https://linear.app/ghost/issue/ENG-2381/post-events - this commit moves the lib code and tests to the core folder so we can colocate code in one place rather than splitting it out across packages, which increases the cognitive load and overhead
1 parent 7ddcc6d commit 052422b

20 files changed

+22
-97
lines changed

.docker/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ COPY ghost/members-csv/package.json ghost/members-csv/package.json
8888
COPY ghost/mw-error-handler/package.json ghost/mw-error-handler/package.json
8989
COPY ghost/mw-vhost/package.json ghost/mw-vhost/package.json
9090
COPY ghost/offers/package.json ghost/offers/package.json
91-
COPY ghost/post-events/package.json ghost/post-events/package.json
9291
COPY ghost/post-revisions/package.json ghost/post-revisions/package.json
9392
COPY ghost/prometheus-metrics/package.json ghost/prometheus-metrics/package.json
9493
COPY ghost/security/package.json ghost/security/package.json

compose.yml

-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ services:
5151
- node_modules_ghost_mw-error-handler:/home/ghost/ghost/mw-error-handler/node_modules:delegated
5252
- node_modules_ghost_mw-vhost:/home/ghost/ghost/mw-vhost/node_modules:delegated
5353
- node_modules_ghost_offers:/home/ghost/ghost/offers/node_modules:delegated
54-
- node_modules_ghost_post-events:/home/ghost/ghost/post-events/node_modules:delegated
5554
- node_modules_ghost_post-revisions:/home/ghost/ghost/post-revisions/node_modules:delegated
5655
- node_modules_ghost_prometheus-metrics:/home/ghost/ghost/prometheus-metrics/node_modules:delegated
5756
- node_modules_ghost_security:/home/ghost/ghost/security/node_modules:delegated
@@ -179,7 +178,6 @@ volumes:
179178
node_modules_ghost_mw-error-handler: {}
180179
node_modules_ghost_mw-vhost: {}
181180
node_modules_ghost_offers: {}
182-
node_modules_ghost_post-events: {}
183181
node_modules_ghost_post-revisions: {}
184182
node_modules_ghost_prometheus-metrics: {}
185183
node_modules_ghost_security: {}

ghost/core/core/server/services/Users.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const ObjectId = require('bson-objectid').default;
77
*/
88
const {PostRevisions} = require('@tryghost/post-revisions');
99
const DomainEvents = require('@tryghost/domain-events/lib/DomainEvents');
10-
const {PostsBulkAddTagsEvent} = require('@tryghost/post-events');
10+
const {PostsBulkAddTagsEvent} = require('../../shared/events');
1111

1212
/**
1313
* @typedef {Object} IdbBackup

ghost/core/core/server/services/posts/PostsService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const {
1212
PostsBulkFeaturedEvent,
1313
PostsBulkUnfeaturedEvent,
1414
PostsBulkAddTagsEvent
15-
} = require('@tryghost/post-events');
15+
} = require('../../../shared/events');
1616

1717
const messages = {
1818
invalidVisibilityFilter: 'Invalid visibility filter.',

ghost/core/core/shared/events/index.js

+12
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,21 @@ module.exports = {
99
MemberSignupEvent: require('./MemberSignupEvent'),
1010
MemberSubscribeEvent: require('./MemberSubscribeEvent'),
1111
MemberUnsubscribeEvent: require('./MemberUnsubscribeEvent'),
12+
1213
OfferRedemptionEvent: require('./OfferRedemptionEvent'),
14+
15+
PostDeletedEvent: require('./PostDeletedEvent').PostDeletedEvent,
16+
17+
PostsBulkAddTagsEvent: require('./PostsBulkAddTagsEvent').PostsBulkAddTagsEvent,
18+
PostsBulkDestroyedEvent: require('./PostsBulkDestroyedEvent').PostsBulkDestroyedEvent,
19+
PostsBulkFeaturedEvent: require('./PostsBulkFeaturedEvent').PostsBulkFeaturedEvent,
20+
PostsBulkUnfeaturedEvent: require('./PostsBulkUnfeaturedEvent').PostsBulkUnfeaturedEvent,
21+
PostsBulkUnpublishedEvent: require('./PostsBulkUnpublishedEvent').PostsBulkUnpublishedEvent,
22+
PostsBulkUnscheduledEvent: require('./PostsBulkUnscheduledEvent').PostsBulkUnscheduledEvent,
23+
1324
SubscriptionActivatedEvent: require('./SubscriptionActivatedEvent'),
1425
SubscriptionCancelledEvent: require('./SubscriptionCancelledEvent'),
1526
SubscriptionCreatedEvent: require('./SubscriptionCreatedEvent'),
27+
1628
URLResourceUpdatedEvent: require('./URLResourceUpdatedEvent')
1729
};

ghost/core/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
"@tryghost/mw-vhost": "0.0.0",
109109
"@tryghost/nodemailer": "0.3.47",
110110
"@tryghost/nql": "0.12.7",
111-
"@tryghost/post-events": "0.0.0",
112111
"@tryghost/post-revisions": "0.0.0",
113112
"@tryghost/pretty-cli": "1.2.46",
114113
"@tryghost/prometheus-metrics": "0.0.0",

ghost/post-events/test/post-events.test.ts renamed to ghost/core/test/unit/shared/events/post-events.test.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import assert from 'assert/strict';
2-
import {
3-
PostDeletedEvent,
4-
PostsBulkDestroyedEvent,
5-
PostsBulkUnpublishedEvent,
6-
PostsBulkUnscheduledEvent,
7-
PostsBulkFeaturedEvent,
8-
PostsBulkUnfeaturedEvent,
9-
PostsBulkAddTagsEvent
10-
} from '../src/index';
2+
3+
import {PostDeletedEvent} from '../../../../core/shared/events/PostDeletedEvent';
4+
import {PostsBulkDestroyedEvent} from '../../../../core/shared/events/PostsBulkDestroyedEvent';
5+
import {PostsBulkUnpublishedEvent} from '../../../../core/shared/events/PostsBulkUnpublishedEvent';
6+
import {PostsBulkUnscheduledEvent} from '../../../../core/shared/events/PostsBulkUnscheduledEvent';
7+
import {PostsBulkFeaturedEvent} from '../../../../core/shared/events/PostsBulkFeaturedEvent';
8+
import {PostsBulkUnfeaturedEvent} from '../../../../core/shared/events/PostsBulkUnfeaturedEvent';
9+
import {PostsBulkAddTagsEvent} from '../../../../core/shared/events/PostsBulkAddTagsEvent';
1110

1211
describe('Post Events', function () {
1312
it('Can instantiate PostDeletedEvent', function () {

ghost/post-events/.eslintrc.js

-6
This file was deleted.

ghost/post-events/README.md

-23
This file was deleted.

ghost/post-events/package.json

-29
This file was deleted.

ghost/post-events/src/index.ts

-8
This file was deleted.

ghost/post-events/test/.eslintrc.js

-7
This file was deleted.

ghost/post-events/tsconfig.json

-9
This file was deleted.

0 commit comments

Comments
 (0)