aboutsummaryrefslogtreecommitdiffstats
path: root/packages/service-shared/src
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-04-08 02:10:22 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-05-16 00:55:00 +0200
commitab1cda612cf6d427bffb66d5674a3673eb958e50 (patch)
treeaeb01a0b431ca850b75d276af745bde807851839 /packages/service-shared/src
parentfix(main): Do not show spurious abort error (diff)
downloadsophie-ab1cda612cf6d427bffb66d5674a3673eb958e50.tar.gz
sophie-ab1cda612cf6d427bffb66d5674a3673eb958e50.tar.zst
sophie-ab1cda612cf6d427bffb66d5674a3673eb958e50.zip
feat(service-preload): Embed service-inject
Embed the service-inject script into the service-preload script to avoid having to load it manually and reduce IPC communication when a service loads. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/service-shared/src')
-rw-r--r--packages/service-shared/src/index.ts2
-rw-r--r--packages/service-shared/src/ipc.ts1
-rw-r--r--packages/service-shared/src/schemas.ts12
3 files changed, 1 insertions, 14 deletions
diff --git a/packages/service-shared/src/index.ts b/packages/service-shared/src/index.ts
index a2e5ee5..5165fe5 100644
--- a/packages/service-shared/src/index.ts
+++ b/packages/service-shared/src/index.ts
@@ -20,4 +20,4 @@
20 20
21export { MainToServiceIpcMessage, ServiceToMainIpcMessage } from './ipc'; 21export { MainToServiceIpcMessage, ServiceToMainIpcMessage } from './ipc';
22 22
23export { UnreadCount, WebSource } from './schemas'; 23export { UnreadCount } from './schemas';
diff --git a/packages/service-shared/src/ipc.ts b/packages/service-shared/src/ipc.ts
index e0a8755..4ead5bd 100644
--- a/packages/service-shared/src/ipc.ts
+++ b/packages/service-shared/src/ipc.ts
@@ -21,6 +21,5 @@
21export enum MainToServiceIpcMessage {} 21export enum MainToServiceIpcMessage {}
22 22
23export enum ServiceToMainIpcMessage { 23export enum ServiceToMainIpcMessage {
24 ApiExposedInMainWorld = 'sophie-service-to-main:api-exposed-in-main-world',
25 SetUnreadCount = 'sophie-service-to-main:set-unread-count', 24 SetUnreadCount = 'sophie-service-to-main:set-unread-count',
26} 25}
diff --git a/packages/service-shared/src/schemas.ts b/packages/service-shared/src/schemas.ts
index bb1926f..799faac 100644
--- a/packages/service-shared/src/schemas.ts
+++ b/packages/service-shared/src/schemas.ts
@@ -31,15 +31,3 @@ export const UnreadCount = /* @__PURE__ */ (() =>
31 Intentionally naming the type the same as the schema definition. 31 Intentionally naming the type the same as the schema definition.
32*/ 32*/
33export type UnreadCount = z.infer<typeof UnreadCount>; 33export type UnreadCount = z.infer<typeof UnreadCount>;
34
35export const WebSource = /* @__PURE__ */ (() =>
36 z.object({
37 code: z.string(),
38 url: z.string().nonempty(),
39 }))();
40
41/*
42 eslint-disable-next-line @typescript-eslint/no-redeclare --
43 Intentionally naming the type the same as the schema definition.
44*/
45export type WebSource = z.infer<typeof WebSource>;