feat(core): open app in electron app entry (#8637)

fix PD-208
fix PD-210
fix PD-209
fix AF-1495
This commit is contained in:
pengx17
2024-10-31 06:16:32 +00:00
parent 5d92c900d1
commit 0f8b273134
36 changed files with 887 additions and 226 deletions
@@ -0,0 +1,44 @@
import { z } from 'zod';
export const appSchemes = z.enum([
'affine',
'affine-canary',
'affine-beta',
'affine-internal',
'affine-dev',
]);
const appChannelSchemes = z.enum(['stable', 'canary', 'beta', 'internal']);
export type Scheme = z.infer<typeof appSchemes>;
export type Channel = z.infer<typeof appChannelSchemes>;
export const schemeToChannel = {
affine: 'stable',
'affine-canary': 'canary',
'affine-beta': 'beta',
'affine-internal': 'internal',
'affine-dev': 'canary', // dev does not have a dedicated app. use canary as the placeholder.
} as Record<Scheme, Channel>;
export const channelToScheme = {
stable: 'affine',
canary:
process.env.NODE_ENV === 'development' ? 'affine-dev' : 'affine-canary',
beta: 'affine-beta',
internal: 'affine-internal',
} as Record<Channel, Scheme>;
export const appIconMap = {
stable: '/imgs/app-icon-stable.ico',
canary: '/imgs/app-icon-canary.ico',
beta: '/imgs/app-icon-beta.ico',
internal: '/imgs/app-icon-internal.ico',
} satisfies Record<Channel, string>;
export const appNames = {
stable: 'AFFiNE',
canary: 'AFFiNE Canary',
beta: 'AFFiNE Beta',
internal: 'AFFiNE Internal',
} satisfies Record<Channel, string>;
@@ -1,3 +1,4 @@
export * from './channel';
export * from './create-emotion-cache';
export * from './event';
export * from './extract-emoji-icon';