Skip to content

Commit c349d90

Browse files
Samarpan  BhattacharyaSamarpan  Bhattacharya
authored andcommitted
fix(provider): make apns provider optional
@parse/node-apn was a dependency but its an optional feature. So its moved as a dev dependency and exported as optional providers. gh-0
1 parent 698e65b commit c349d90

File tree

4 files changed

+57
-14
lines changed

4 files changed

+57
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ typings/
6262

6363
# Cache used by TypeScript's incremental build
6464
*.tsbuildinfo
65+
66+
.DS_Store

package-lock.json

Lines changed: 39 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
"type": "./dist/providers/email/ses/index.d.ts",
1919
"default": "./dist/providers/email/ses/index.js"
2020
},
21+
"./apns": {
22+
"type": "./dist/providers/push/apns/index.d.ts",
23+
"default": "./dist/providers/push/apns/index.js"
24+
},
2125
"./fcm": {
2226
"type": "./dist/providers/push/fcm/index.d.ts",
2327
"default": "./dist/providers/push/fcm/index.js"
@@ -43,6 +47,9 @@
4347
"ses": [
4448
"./dist/providers/email/ses/index.d.ts"
4549
],
50+
"apns": [
51+
"./dist/providers/push/apns/index.d.ts"
52+
],
4653
"fcm": [
4754
"./dist/providers/push/fcm/index.d.ts"
4855
],
@@ -58,7 +65,7 @@
5865
}
5966
},
6067
"engines": {
61-
"node": ">=10"
68+
"node": ">=14"
6269
},
6370
"scripts": {
6471
"build": "lb-tsc",
@@ -96,7 +103,6 @@
96103
"@loopback/context": "^5.0.7",
97104
"@loopback/core": "^4.0.7",
98105
"@loopback/rest": "^12.0.7",
99-
"@parse/node-apn": "^5.1.3",
100106
"tslib": "^2.0.0"
101107
},
102108
"devDependencies": {
@@ -105,6 +111,7 @@
105111
"@loopback/build": "^9.0.7",
106112
"@loopback/eslint-config": "^13.0.7",
107113
"@loopback/testlab": "^5.0.7",
114+
"@parse/node-apn": "^5.1.3",
108115
"@semantic-release/changelog": "^6.0.1",
109116
"@semantic-release/commit-analyzer": "^9.0.2",
110117
"@semantic-release/git": "^10.0.1",

src/component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ import {Binding, Component, ProviderMap} from '@loopback/core';
22
import {NotificationBindings} from './keys';
33
import {SESBindings} from './providers/email/ses/keys';
44
import {NotificationProvider} from './providers/notification.provider';
5+
import {ApnsBinding} from './providers/push/apns/keys';
6+
import {FcmBindings} from './providers/push/fcm/keys';
57
import {PubnubBindings} from './providers/push/pubnub/keys';
68
import {SocketBindings} from './providers/push/socketio/keys';
79
import {SNSBindings} from './providers/sms/sns/keys';
810

911
export class NotificationsComponent implements Component {
10-
constructor() {}
12+
constructor() {
13+
// Intentionally left blank
14+
}
1115

1216
providers?: ProviderMap = {
1317
[NotificationBindings.NotificationProvider.key]: NotificationProvider,
@@ -19,5 +23,7 @@ export class NotificationsComponent implements Component {
1923
Binding.bind(SNSBindings.Config.key).to(null),
2024
Binding.bind(PubnubBindings.Config.key).to(null),
2125
Binding.bind(SocketBindings.Config.key).to(null),
26+
Binding.bind(ApnsBinding.Config.key).to(null),
27+
Binding.bind(FcmBindings.Config.key).to(null),
2228
];
2329
}

0 commit comments

Comments
 (0)