chore: standardize tsconfig (#9568)

This commit is contained in:
forehalo
2025-01-08 04:07:56 +00:00
parent 39f4b17315
commit c0ed74dfed
151 changed files with 1041 additions and 1566 deletions

View File

@@ -1 +0,0 @@
lib

View File

@@ -1,61 +1,5 @@
import { UaHelper } from './ua-helper.js';
export type BUILD_CONFIG_TYPE = {
debug: boolean;
distribution: 'web' | 'desktop' | 'admin' | 'mobile' | 'ios' | 'android';
/**
* 'web' | 'desktop' | 'admin'
*/
isDesktopEdition: boolean;
/**
* 'mobile'
*/
isMobileEdition: boolean;
isElectron: boolean;
isWeb: boolean;
isMobileWeb: boolean;
isIOS: boolean;
isAndroid: boolean;
isAdmin: boolean;
// this is for the electron app
/**
* @deprecated need to be refactored
*/
serverUrlPrefix: string;
appVersion: string;
editorVersion: string;
appBuildType: 'stable' | 'beta' | 'internal' | 'canary';
githubUrl: string;
changelogUrl: string;
downloadUrl: string;
// see: tools/workers
imageProxyUrl: string;
linkPreviewUrl: string;
};
export type Environment = {
// Variant
isSelfHosted: boolean;
// Device
isLinux: boolean;
isMacOs: boolean;
isIOS: boolean;
isSafari: boolean;
isWindows: boolean;
isFireFox: boolean;
isMobile: boolean;
isChrome: boolean;
isPwa: boolean;
chromeVersion?: number;
// runtime configs
publicPath: string;
};
export function setupGlobal() {
if (globalThis.$AFFINE_SETUP) {
return;

View File

@@ -1,9 +1,11 @@
{
"extends": "../../../tsconfig.json",
"include": ["./src"],
"extends": "../../../tsconfig.web.json",
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
}
"types": ["build-config", "affine__env"],
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"references": [{ "path": "../../../blocksuite/affine/all" }]
}