refactor(infra): directory structure (#4615)

This commit is contained in:
Joooye_34
2023-10-18 23:30:08 +08:00
committed by GitHub
parent 814d552be8
commit bed9310519
1150 changed files with 539 additions and 584 deletions
@@ -0,0 +1,33 @@
import { z } from 'zod';
export const ReleaseTypeSchema = z.enum([
'stable',
'beta',
'canary',
'internal',
]);
export const envBuildType = (
process.env.BUILD_TYPE_OVERRIDE ||
process.env.BUILD_TYPE ||
'canary'
)
.trim()
.toLowerCase();
export const overrideSession = process.env.BUILD_TYPE === 'internal';
export const buildType = ReleaseTypeSchema.parse(envBuildType);
export const mode = process.env.NODE_ENV;
export const isDev = mode === 'development';
const API_URL_MAPPING = {
stable: `https://app.affine.pro`,
beta: `https://insider.affine.pro`,
canary: `https://affine.fail`,
internal: `https://insider.affine.pro`,
};
export const CLOUD_BASE_URL =
process.env.DEV_SERVER_URL || API_URL_MAPPING[buildType];