mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
chore(server): local data migration env (#9080)
This commit is contained in:
@@ -4,7 +4,7 @@ import { AppStartupConfig } from './types';
|
||||
export type EnvConfigType = 'string' | 'int' | 'float' | 'boolean';
|
||||
export type ServerFlavor = 'allinone' | 'graphql' | 'sync' | 'renderer';
|
||||
export type AFFINE_ENV = 'dev' | 'beta' | 'production';
|
||||
export type NODE_ENV = 'development' | 'test' | 'production';
|
||||
export type NODE_ENV = 'development' | 'test' | 'production' | 'script';
|
||||
|
||||
export enum DeploymentType {
|
||||
Affine = 'affine',
|
||||
@@ -25,7 +25,12 @@ export interface PreDefinedAFFiNEConfig {
|
||||
readonly isSelfhosted: boolean;
|
||||
readonly flavor: { type: string } & { [key in ServerFlavor]: boolean };
|
||||
readonly affine: { canary: boolean; beta: boolean; stable: boolean };
|
||||
readonly node: { prod: boolean; dev: boolean; test: boolean };
|
||||
readonly node: {
|
||||
prod: boolean;
|
||||
dev: boolean;
|
||||
test: boolean;
|
||||
script: boolean;
|
||||
};
|
||||
readonly deploy: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ function getPredefinedAFFiNEConfig(): PreDefinedAFFiNEConfig {
|
||||
'development',
|
||||
'test',
|
||||
'production',
|
||||
'script',
|
||||
]);
|
||||
const AFFINE_ENV = readEnv<AFFINE_ENV>('AFFINE_ENV', 'dev', [
|
||||
'dev',
|
||||
@@ -47,6 +48,7 @@ function getPredefinedAFFiNEConfig(): PreDefinedAFFiNEConfig {
|
||||
prod: NODE_ENV === 'production',
|
||||
dev: NODE_ENV === 'development',
|
||||
test: NODE_ENV === 'test',
|
||||
script: NODE_ENV === 'script',
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -35,9 +35,9 @@ export type GraphqlContext = {
|
||||
},
|
||||
autoSchemaFile: join(
|
||||
fileURLToPath(import.meta.url),
|
||||
config.node.test
|
||||
? '../../../../node_modules/.cache/schema.gql'
|
||||
: '../../../schema.gql'
|
||||
config.node.dev
|
||||
? '../../../schema.gql'
|
||||
: '../../../../node_modules/.cache/schema.gql'
|
||||
),
|
||||
sortSchema: true,
|
||||
context: ({
|
||||
|
||||
Reference in New Issue
Block a user