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,9 +1,8 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.node.json",
"compilerOptions": {
"noEmit": false,
"outDir": "lib",
"composite": true
"outDir": "./dist"
},
"include": ["index.d.ts"]
"include": ["index.d.ts"],
"references": []
}

View File

@@ -1,16 +0,0 @@
import crypto from 'node:crypto';
const { privateKey, publicKey } = crypto.generateKeyPairSync('ec', {
namedCurve: 'prime256v1',
publicKeyEncoding: {
type: 'spki',
format: 'pem',
},
privateKeyEncoding: {
type: 'pkcs8',
format: 'pem',
},
});
console.log('ECDSA Public Key:\n', publicKey);
console.log('ECDSA Private Key:\n', privateKey);

View File

@@ -1,18 +0,0 @@
import { createTransport } from 'nodemailer';
const transport = createTransport({
host: '0.0.0.0',
port: 1025,
secure: false,
auth: {
user: 'himself65',
pass: '123456',
},
});
await transport.sendMail({
from: 'noreply@toeverything.info',
to: 'himself65@outlook.com',
subject: 'test',
html: `<div>hello world</div>`,
});

View File

@@ -47,7 +47,7 @@ export class CaptchaService {
body: formData,
method: 'POST',
});
const outcome = await result.json();
const outcome: any = await result.json();
return (
!!outcome.success &&

View File

@@ -23,7 +23,7 @@ export class CopilotWorkflowService {
const node = workflow.get(nodeData.id);
if (!node) {
this.logger.error(
`Failed to init workflow ${name}: node ${nodeData.id} not found`
`Failed to init workflow ${graph.name}: node ${nodeData.id} not found`
);
throw new Error(`Node ${nodeData.id} not found`);
}
@@ -31,7 +31,7 @@ export class CopilotWorkflowService {
const edge = workflow.get(edgeId);
if (!edge) {
this.logger.error(
`Failed to init workflow ${name}: edge ${edgeId} not found in node ${nodeData.id}`
`Failed to init workflow ${graph.name}: edge ${edgeId} not found in node ${nodeData.id}`
);
throw new Error(`Edge ${edgeId} not found`);
}

View File

@@ -1,23 +0,0 @@
{
"extends": "../../../../tsconfig.json",
"compilerOptions": {
"composite": true,
"target": "ES2022",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"rootDir": ".",
"outDir": "../lib/tests",
"verbatimModuleSyntax": false,
"tsBuildInfoFile": "../lib/tests/.tsbuildinfo"
},
"references": [
{
"path": "../tsconfig.json"
},
{
"path": "../../../../tests/kit/tsconfig.json"
}
],
"include": ["."],
"exclude": []
}

View File

@@ -1,33 +1,18 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.node.json",
"compilerOptions": {
"composite": true,
"target": "ES2022",
"module": "ESNext",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "Bundler",
"allowSyntheticDefaultImports": true,
"isolatedModules": false,
"resolveJsonModule": true,
"types": ["node"],
"outDir": "dist",
"noEmit": false,
"verbatimModuleSyntax": false,
"rootDir": "./src"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"exclude": ["dist", "lib", "tests"],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "../native/tsconfig.json"
}
],
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
}
{ "path": "../../../tests/kit" },
{ "path": "../../../tools/cli" },
{ "path": "../native" }
]
}

View File

@@ -1,20 +1,10 @@
{
"extends": "../../../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
"target": "ESNext",
"module": "ESNext",
"resolveJsonModule": true,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"outDir": "./lib/scripts",
"rootDir": "."
"allowJs": true,
"rootDir": ".",
"outDir": "./lib",
"tsBuildInfoFile": "./lib/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../../../tests/kit"
}
],
"include": ["scripts", "package.json"],
"exclude": ["tests"]
"include": ["./scripts", "./tests"]
}

View File

@@ -1 +0,0 @@
lib

View File

@@ -1,7 +1,9 @@
{
"name": "@affine/debug",
"private": true,
"main": "./src/index.ts",
"exports": {
".": "./src/index.ts"
},
"dependencies": {
"debug": "^4.4.0"
},

View File

@@ -1,13 +1,10 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"sourceMap": true,
"composite": true,
"noEmit": false,
"outDir": "lib"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"exclude": ["node_modules"]
"references": []
}

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" }]
}

View File

@@ -1,17 +1,10 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"include": ["./src"],
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../env"
},
{
"path": "../debug"
}
]
"references": [{ "path": "../debug" }, { "path": "../env" }]
}

View File

@@ -1,20 +1,10 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"include": ["./src"],
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../../frontend/graphql"
},
{
"path": "../infra"
},
{
"path": "../../../blocksuite/affine/all"
}
]
"references": [{ "path": "../infra" }, { "path": "../../frontend/graphql" }]
}

View File

@@ -67,6 +67,7 @@
"update-shadcn": "shadcn-ui add -p src/components/ui"
},
"exports": {
"./*": "./src/*"
"./*": "./src/*.ts",
"./components/ui/*": "./src/components/ui/*.tsx"
}
}

View File

@@ -6,7 +6,8 @@ import {
ToastTitle,
ToastViewport,
} from '@affine/admin/components/ui/toast';
import { useToast } from '@affine/admin/components/ui/use-toast';
import { useToast } from './use-toast';
export function Toaster() {
const { toasts } = useToast();

View File

@@ -1,17 +1,15 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"include": ["./src"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"allowJs": true,
"composite": true,
"verbatimModuleSyntax": false,
"jsx": "react-jsx"
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"references": [
{ "path": "../component" },
{ "path": "../core" },
{ "path": "../graphql" },
{ "path": "../../common/infra" }
],
"exclude": ["dist"]
]
}

View File

@@ -3,7 +3,6 @@
"version": "0.19.0",
"description": "AFFiNE Desktop Web application",
"private": true,
"browser": "src/index.tsx",
"scripts": {
"build": "affine bundle",
"dev": "affine bundle --dev"

View File

@@ -1,12 +1,15 @@
{
"extends": "../../../../tsconfig.json",
"extends": "../../../../tsconfig.web.json",
"compilerOptions": {
"composite": true,
"outDir": "lib",
"moduleResolution": "Bundler",
"types": ["affine__env"],
"rootDir": "./src"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"references": [{ "path": "../../core" }]
"references": [
{ "path": "../../component" },
{ "path": "../../core" },
{ "path": "../../i18n" },
{ "path": "../../../../blocksuite/affine/all" }
]
}

View File

@@ -1,17 +1,17 @@
{
"extends": "../../../../tsconfig.json",
"extends": "../../../../tsconfig.web.json",
"compilerOptions": {
"composite": true,
"outDir": "lib",
"moduleResolution": "Bundler",
"types": ["affine__env"],
"rootDir": "./src"
"rootDir": "./src",
// dist is kept for webpack output
"outDir": "./lib",
"tsBuildInfoFile": "./lib/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"references": [
{ "path": "../../component" },
{ "path": "../../core" },
{
"path": "../../electron-api"
}
{ "path": "../../electron-api" },
{ "path": "../../i18n" },
{ "path": "../../../../tools/utils" }
]
}

View File

@@ -10,6 +10,15 @@
},
"description": "AFFiNE Desktop App",
"homepage": "https://github.com/toeverything/AFFiNE",
"exports": {
"./helper/exposed": "./src/helper/exposed.ts",
"./main/exposed": "./src/main/exposed.ts",
"./preload/electron-api": "./src/preload/electron-api.ts",
"./preload/shared-storage": "./src/preload/shared-storage.ts",
"./main/shared-state-schema": "./src/main/shared-state-schema.ts",
"./main/updater/event": "./src/main/updater/event.ts",
"./main/windows-manager": "./src/main/windows-manager/index.ts"
},
"scripts": {
"start": "electron .",
"dev": "cross-env DEV_SERVER_URL=http://localhost:8080 node ./scripts/dev.ts",

View File

@@ -106,7 +106,7 @@ export const uiHandlers = {
link =
'https://api.fxtwitter.com/status/' + /\/status\/(.*)/.exec(link)?.[1];
try {
const { tweet } = await fetch(link).then(res => res.json());
const { tweet } = (await fetch(link).then(res => res.json())) as any;
return {
title: tweet.author.name,
icon: tweet.author.avatar_url,

View File

@@ -9,11 +9,14 @@ import {
WebContentViewsManager,
} from './tab-views';
export const showTabContextMenu = async (tabId: string, viewIndex: number) => {
export const showTabContextMenu = async (
tabId: string,
viewIndex: number
): Promise<TabAction | null> => {
const workbenches = WebContentViewsManager.instance.tabViewsMeta.workbenches;
const tabMeta = workbenches.find(w => w.id === tabId);
if (!tabMeta) {
return;
return null;
}
const { resolve, promise } = Promise.withResolvers<TabAction | null>();
@@ -93,7 +96,7 @@ export const showTabContextMenu = async (tabId: string, viewIndex: number) => {
];
const menu = Menu.buildFromTemplate(template);
menu.popup();
// eslint-disable-next-line prefer-const
let unsub: (() => void) | undefined;
const subscription = WebContentViewsManager.instance.tabAction$.subscribe(
action => {

View File

@@ -1,4 +1,6 @@
// Please add modules to `external` in `rollupOptions` to avoid wrong bundling.
import type { MessagePort } from 'node:worker_threads';
import type { EventBasedChannel } from 'async-call-rpc';
import { AsyncCall } from 'async-call-rpc';
import { ipcRenderer } from 'electron';
@@ -135,12 +137,13 @@ const helperPort = new Promise<MessagePort>(resolve =>
const createMessagePortChannel = (port: MessagePort): EventBasedChannel => {
return {
on(listener) {
port.onmessage = e => {
const listen = (e: MessageEvent) => {
listener(e.data);
};
port.addEventListener('message', listen as any);
port.start();
return () => {
port.onmessage = null;
port.removeEventListener('message', listen as any);
try {
port.close();
} catch (err) {
@@ -246,10 +249,15 @@ export const events = {
...helperAPIs.events,
};
// Create MessagePort that can be used by web workers
/**
* Create MessagePort that can be used by web workers
*
* !!!
* SHOULD ONLY BE USED IN RENDERER PROCESS
* !!!
*/
export function requestWebWorkerPort() {
const ch = new MessageChannel();
const localPort = ch.port1;
const remotePort = ch.port2;
@@ -274,6 +282,7 @@ export function requestWebWorkerPort() {
const portId = crypto.randomUUID();
setTimeout(() => {
// @ts-expect-error this function should only be evaluated in the renderer process
window.postMessage(
{
type: 'electron:request-api-port',

View File

@@ -1,45 +1,16 @@
{
"extends": "../../../../tsconfig.json",
"extends": "../../../../tsconfig.node.json",
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"target": "ES2022",
"module": "ESNext",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"types": ["node", "affine__env"],
"outDir": "lib",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"noImplicitOverride": true,
"paths": {
"@toeverything/infra/*": ["../../common/infra/src/*"]
}
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"exclude": ["renderer", "node_modules", "lib", "dist", "**/__tests__/**/*"],
"references": [
{
"path": "../../../frontend/native"
},
{
"path": "../../../common/infra"
},
{
"path": "../../../common/env"
},
{
"path": "./tsconfig.node.json"
},
{
"path": "../../../../tests/kit"
},
{
"path": "../../../../tools/utils"
}
],
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
}
{ "path": "../../../../tests/kit" },
{ "path": "../../../../tools/utils" },
{ "path": "../../native" },
{ "path": "../../../common/nbstore" },
{ "path": "../../../common/infra" }
]
}

View File

@@ -1,26 +1,9 @@
{
"extends": "../../../../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
"target": "ESNext",
"module": "ESNext",
"resolveJsonModule": true,
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"noEmit": false,
"outDir": "./lib/scripts",
"types": ["node", "affine__env"],
"allowJs": true
"rootDir": ".",
"outDir": "./lib",
"tsBuildInfoFile": "./lib/tsconfig.tsbuildinfo"
},
"include": ["./scripts"],
"exclude": ["./renderer"],
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
},
"references": [
{
"path": "../../../../tools/utils"
}
]
"include": ["./test", "./scripts", "./vitest.config.ts"]
}

View File

@@ -1,21 +0,0 @@
{
"extends": "../../../../tsconfig.json",
"compilerOptions": {
"composite": true,
"target": "ESNext",
"module": "ESNext",
"resolveJsonModule": true,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"noEmit": false,
"outDir": "./lib/tests",
"types": ["node", "affine__env"],
"allowJs": true
},
"references": [
{
"path": "./tsconfig.json"
}
],
"include": ["./test"]
}

View File

@@ -23,7 +23,6 @@ const readFileAsBase64 = (file: File) =>
});
const convertFormData = async (formData: FormData) => {
const newFormData = [];
// @ts-expect-error FormData.entries
for (const pair of formData.entries()) {
const [key, value] = pair;
if (value instanceof File) {
@@ -47,7 +46,7 @@ const convertBody = async (body: unknown, contentType: string) => {
if (body instanceof ReadableStream) {
const reader = body.getReader();
const chunks = [];
// eslint-disable-next-line no-constant-condition
while (true) {
const { done, value } = await reader.read();
if (done) break;
@@ -129,7 +128,6 @@ export function configureFetchProvider(framework: Framework) {
console.time(tag);
try {
const { body } = request;
// @ts-expect-error Headers.entries
const optionHeaders = Object.fromEntries(request.headers.entries());
const {
data: requestData,

View File

@@ -50,7 +50,7 @@ function main() {
}
function mountApp() {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
// oxlint-disable-next-line @typescript-eslint/no-non-null-assertion
const root = document.getElementById('app')!;
createRoot(root).render(
<StrictMode>

View File

@@ -1,16 +1,17 @@
{
"extends": "../../../../tsconfig.json",
"extends": "../../../../tsconfig.web.json",
"compilerOptions": {
"composite": true,
"outDir": "lib",
"moduleResolution": "Bundler",
"types": ["affine__env"],
"rootDir": "./src"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"references": [
{ "path": "../../component" },
{ "path": "../../core" },
{ "path": "../../native" },
{ "path": "../../../common/nbstore" }
{ "path": "../../i18n" },
{ "path": "../../../../blocksuite/affine/all" },
{ "path": "../../../common/infra" },
{ "path": "../../native" }
]
}

View File

@@ -1,12 +1,15 @@
{
"extends": "../../../../tsconfig.json",
"extends": "../../../../tsconfig.web.json",
"compilerOptions": {
"composite": true,
"outDir": "lib",
"moduleResolution": "Bundler",
"types": ["affine__env"],
"rootDir": "./src"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"references": [{ "path": "../../core" }]
"references": [
{ "path": "../../component" },
{ "path": "../../core" },
{ "path": "../../i18n" },
{ "path": "../../../../blocksuite/affine/all" }
]
}

View File

@@ -43,7 +43,7 @@ function main() {
}
function mountApp() {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
// oxlint-disable-next-line @typescript-eslint/no-non-null-assertion
const root = document.getElementById('app')!;
createRoot(root).render(
<StrictMode>

View File

@@ -1,12 +1,14 @@
{
"extends": "../../../../tsconfig.json",
"extends": "../../../../tsconfig.web.json",
"compilerOptions": {
"composite": true,
"outDir": "lib",
"moduleResolution": "Bundler",
"types": ["affine__env"],
"rootDir": "./src"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src"],
"references": [{ "path": "../../core" }]
"references": [
{ "path": "../../component" },
{ "path": "../../core" },
{ "path": "../../i18n" }
]
}

View File

@@ -2,7 +2,6 @@ import { ArrowRightSmallIcon } from '@blocksuite/icons/rc';
import clsx from 'clsx';
import { useMemo, useState } from 'react';
import type { Location } from 'react-router-dom';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { useLocation, useNavigate } from 'react-router-dom';
import useSWR from 'swr';

View File

@@ -1,5 +1,6 @@
export {
type GlobalLoadingEvent,
globalLoadingEventsAtom,
pushGlobalLoadingEventAtom,
resolveGlobalLoadingEventAtom,
} from './index.jotai';

View File

@@ -1,6 +1,5 @@
{
"extends": "../../../tsconfig.json",
"exclude": ["lib"],
"extends": "../../../tsconfig.web.json",
"include": [
"./src/**/*",
"./src/**/*.json",
@@ -8,25 +7,15 @@
"./.storybook"
],
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
"rootDir": ".",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../../frontend/i18n"
},
{
"path": "../../frontend/electron-api"
},
{
"path": "../../frontend/graphql"
},
{
"path": "../../common/debug"
},
{
"path": "../../common/infra"
}
{ "path": "../../common/debug" },
{ "path": "../electron-api" },
{ "path": "../graphql" },
{ "path": "../i18n" },
{ "path": "../../../blocksuite/affine/all" }
]
}

View File

@@ -1,5 +1,5 @@
import { Loading } from '@affine/component';
import { globalLoadingEventsAtom } from '@affine/component/global-loading/index.jotai';
import { globalLoadingEventsAtom } from '@affine/component/global-loading';
import { useAtomValue } from 'jotai';
import { type ReactNode, useEffect, useState } from 'react';

View File

@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* oxlint-disable @typescript-eslint/no-non-null-assertion */
import { Entity } from '@toeverything/infra';
import type { DesktopApiProvider } from '../provider';

View File

@@ -1,5 +1,5 @@
import type { AppInfo } from '@affine/electron/preload/electron-api';
import type {
AppInfo,
ClientEvents,
ClientHandler,
SharedStorage,

View File

@@ -1,33 +1,19 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"compilerOptions": {
"outDir": "lib",
"typeRoots": ["../../../node_modules", "../../../node_modules/@types"],
"types": ["webpack-env", "ses", "affine__env"]
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.json"],
"exclude": ["node_modules"],
"include": ["./src", "src/**/*.json"],
"references": [
{
"path": "../../frontend/component"
},
{
"path": "../../frontend/graphql"
},
{
"path": "../../frontend/i18n"
},
{
"path": "../../frontend/electron-api"
},
{
"path": "../../common/debug"
},
{
"path": "../../common/env"
},
{
"path": "../../../blocksuite/affine/all"
}
{ "path": "../component" },
{ "path": "../../common/debug" },
{ "path": "../electron-api" },
{ "path": "../../common/env" },
{ "path": "../graphql" },
{ "path": "../i18n" },
{ "path": "../track" },
{ "path": "../../../blocksuite/affine/all" }
]
}

View File

@@ -10,5 +10,8 @@
},
"dependencies": {
"async-call-rpc": "^6.4.2"
},
"devDependencies": {
"@affine/electron": "workspace:*"
}
}

View File

@@ -6,7 +6,7 @@ import type {
events as mainEvents,
handlers as mainHandlers,
} from '@affine/electron/main/exposed';
import type { appInfo as exposedAppInfo } from '@affine/electron/preload/electron-api';
import type { AppInfo } from '@affine/electron/preload/electron-api';
import type { SharedStorage } from '@affine/electron/preload/shared-storage';
type MainHandlers = typeof mainHandlers;
@@ -29,9 +29,7 @@ export type ClientHandler = {
} & HelperHandlers;
export type ClientEvents = MainEvents & HelperEvents;
export const appInfo = (globalThis as any).__appInfo as
| typeof exposedAppInfo
| null;
export const appInfo = (globalThis as any).__appInfo as AppInfo | null;
export const apis = (globalThis as any).__apis as ClientHandler | undefined;
export const events = (globalThis as any).__events as ClientEvents | undefined;
@@ -39,7 +37,7 @@ export const sharedStorage = (globalThis as any).__sharedStorage as
| SharedStorage
| undefined;
export type { SharedStorage };
export type { AppInfo, SharedStorage };
export {
type SpellCheckStateSchema,
@@ -49,3 +47,7 @@ export {
type WorkbenchViewModule,
} from '@affine/electron/main/shared-state-schema';
export type { UpdateMeta } from '@affine/electron/main/updater/event';
export type {
AddTabOption,
TabAction,
} from '@affine/electron/main/windows-manager';

View File

@@ -1,17 +1,10 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"include": ["./src"],
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../../common/infra"
},
{
"path": "../../frontend/apps/electron"
}
]
"references": [{ "path": "../apps/electron" }]
}

View File

@@ -1,14 +1,10 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"include": ["./src"],
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../../common/env"
}
]
"references": [{ "path": "../../common/env" }]
}

View File

@@ -1,18 +1,14 @@
{
"extends": "../../../tsconfig.json",
"include": ["./src"],
"exclude": ["./src/resources", "./src/scripts"],
"extends": "../../../tsconfig.web.json",
"include": [
"./src",
"./src/resources/*.json",
"./src/i18n-completenesses.json"
],
"compilerOptions": {
"noEmit": false,
"composite": true,
"outDir": "lib"
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "./tsconfig.resources.json"
},
{
"path": "../../common/debug/tsconfig.json"
}
]
"references": [{ "path": "../../common/debug" }]
}

View File

@@ -1,13 +0,0 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"composite": true,
"module": "NodeNext",
"resolveJsonModule": true,
"moduleResolution": "nodenext",
"outDir": "lib/resources",
"noEmit": false
},
"include": ["./src/resources/**/*.ts", "./src/**/*.json"],
"exclude": ["dist", "lib"]
}

View File

@@ -1,14 +1,8 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.node.json",
"compilerOptions": {
"noEmit": false,
"outDir": "lib",
"composite": true,
"types": ["node"]
"outDir": "./dist"
},
"include": ["index.d.ts", "__tests__/**/*.mts"],
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
}
"include": ["index.d.ts"],
"references": []
}

View File

@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { DebugLogger } from '@affine/debug';
import type { OverridedMixpanel } from 'mixpanel-browser';
import mixpanelBrowser from 'mixpanel-browser';

View File

@@ -1,15 +1,10 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.web.json",
"compilerOptions": {
"outDir": "lib",
"typeRoots": ["../../../node_modules", "../../../node_modules/@types"],
"types": ["affine__env"]
"rootDir": "./src",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.json"],
"exclude": ["node_modules"],
"references": [
{
"path": "../../common/debug"
}
]
"include": ["./src"],
"references": [{ "path": "../../common/debug" }]
}