mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
feat: bump typescript (#14507)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Upgraded TypeScript toolchain to v5.9.3 across packages and tooling. * Removed legacy ts-node and migrated developer tooling to newer runtimes (tsx/SWC) where applicable. * **Documentation** * Updated developer CLI docs and runtime behavior notes to reflect the new loader/runtime for running TypeScript files; no changes to public APIs or end-user behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -2,8 +2,8 @@ import test from 'ava';
|
||||
|
||||
import { createModule } from '../../../__tests__/create-module';
|
||||
import { InvalidAppConfig } from '../../error';
|
||||
import { ConfigFactory, ConfigModule } from '..';
|
||||
import { Config } from '../config';
|
||||
import { ConfigFactory, ConfigModule } from '../index';
|
||||
import { override } from '../register';
|
||||
|
||||
const module = await createModule();
|
||||
|
||||
@@ -8,8 +8,8 @@ import Sinon from 'sinon';
|
||||
import { createTestingModule } from '../../../../__tests__/utils';
|
||||
import { ConfigModule } from '../../../config';
|
||||
import { metrics } from '../../../metrics';
|
||||
import { JobModule, JobQueue, OnJob } from '..';
|
||||
import { JobExecutor } from '../executor';
|
||||
import { JobModule, JobQueue, OnJob } from '../index';
|
||||
import { JobHandlerScanner } from '../scanner';
|
||||
|
||||
let module: TestingModule;
|
||||
|
||||
@@ -5,7 +5,7 @@ import test from 'ava';
|
||||
import { createModule } from '../../../__tests__/create-module';
|
||||
import { Mockers } from '../../../__tests__/mocks';
|
||||
import { Comment, CommentChangeAction } from '../../../models';
|
||||
import { CommentModule } from '..';
|
||||
import { CommentModule } from '../index';
|
||||
import { CommentService } from '../service';
|
||||
|
||||
const module = await createModule({
|
||||
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
type TestingModule,
|
||||
} from '../../../__tests__/utils';
|
||||
import { Models, User, Workspace } from '../../../models';
|
||||
import { DocReader, PgWorkspaceDocStorageAdapter as Adapter } from '..';
|
||||
import { DocEventsListener } from '../event';
|
||||
import { DocReader, PgWorkspaceDocStorageAdapter as Adapter } from '../index';
|
||||
|
||||
interface Context {
|
||||
module: TestingModule;
|
||||
|
||||
@@ -7,7 +7,11 @@ import { applyUpdate, Doc as YDoc } from 'yjs';
|
||||
import { createModule } from '../../../__tests__/create-module';
|
||||
import { Mockers } from '../../../__tests__/mocks';
|
||||
import { Models } from '../../../models';
|
||||
import { DocReader, DocStorageModule, PgWorkspaceDocStorageAdapter } from '..';
|
||||
import {
|
||||
DocReader,
|
||||
DocStorageModule,
|
||||
PgWorkspaceDocStorageAdapter,
|
||||
} from '../index';
|
||||
import { DatabaseDocReader } from '../reader';
|
||||
|
||||
const module = await createModule({
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
DocReader,
|
||||
DocStorageModule,
|
||||
PgWorkspaceDocStorageAdapter,
|
||||
} from '..';
|
||||
} from '../index';
|
||||
import { RpcDocReader } from '../reader';
|
||||
|
||||
const module = await createModule({
|
||||
|
||||
@@ -20,7 +20,7 @@ import { FeatureModule } from '../../features';
|
||||
import { MailModule } from '../../mail';
|
||||
import { PermissionModule } from '../../permission';
|
||||
import { StorageModule } from '../../storage';
|
||||
import { NotificationModule } from '..';
|
||||
import { NotificationModule } from '../index';
|
||||
import { NotificationService } from '../service';
|
||||
|
||||
const module = await createModule({
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
WorkspaceMemberStatus,
|
||||
WorkspaceRole,
|
||||
} from '../../../models';
|
||||
import { PermissionModule } from '..';
|
||||
import { DocAccessController } from '../doc';
|
||||
import { PermissionModule } from '../index';
|
||||
import { DocRole, mapDocRoleToPermissions } from '../types';
|
||||
|
||||
let module: TestingModule;
|
||||
|
||||
@@ -2,8 +2,8 @@ import test from 'ava';
|
||||
|
||||
import { createModule } from '../../../__tests__/create-module';
|
||||
import { Mockers } from '../../../__tests__/mocks';
|
||||
import { DocRole, PermissionModule, WorkspaceRole } from '..';
|
||||
import { AccessControllerBuilder } from '../builder';
|
||||
import { DocRole, PermissionModule, WorkspaceRole } from '../index';
|
||||
|
||||
const module = await createModule({
|
||||
imports: [PermissionModule],
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
WorkspaceMemberStatus,
|
||||
WorkspaceRole,
|
||||
} from '../../../models';
|
||||
import { PermissionModule } from '..';
|
||||
import { PermissionModule } from '../index';
|
||||
import { mapWorkspaceRoleToPermissions } from '../types';
|
||||
import { WorkspaceAccessController } from '../workspace';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import test from 'ava';
|
||||
import { createModule } from '../../../__tests__/create-module';
|
||||
import { Mockers } from '../../../__tests__/mocks';
|
||||
import { Models } from '../../../models';
|
||||
import { CommentAttachmentStorage, StorageModule } from '..';
|
||||
import { CommentAttachmentStorage, StorageModule } from '../index';
|
||||
|
||||
const module = await createModule({
|
||||
imports: [StorageModule],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { render as rawRender } from '@react-email/components';
|
||||
import { type ComponentType, createElement, type ReactElement } from 'react';
|
||||
|
||||
import { Comment, CommentMention, Mention } from './docs';
|
||||
import {
|
||||
@@ -40,14 +41,14 @@ type EmailContent = {
|
||||
html: string;
|
||||
};
|
||||
|
||||
function render(component: React.ReactElement) {
|
||||
function render(component: ReactElement) {
|
||||
return rawRender(component, { pretty: env.testing });
|
||||
}
|
||||
|
||||
type Props<T> = T extends React.ComponentType<infer P> ? P : never;
|
||||
type Props<T> = T extends ComponentType<infer P> ? P : never;
|
||||
export type EmailRenderer<Props> = (props: Props) => Promise<EmailContent>;
|
||||
|
||||
function make<T extends React.ComponentType<any>>(
|
||||
function make<T extends ComponentType<any>>(
|
||||
Component: T,
|
||||
subject: string | ((props: Props<T>) => string)
|
||||
): EmailRenderer<Props<T>> {
|
||||
@@ -58,7 +59,7 @@ function make<T extends React.ComponentType<any>>(
|
||||
}
|
||||
return {
|
||||
subject: typeof subject === 'function' ? subject(props) : subject,
|
||||
html: await render(<Component {...props} />),
|
||||
html: await render(createElement(Component, props)),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import test from 'ava';
|
||||
import { createModule } from '../../__tests__/create-module';
|
||||
import { Mockers } from '../../__tests__/mocks';
|
||||
import { Due } from '../../base';
|
||||
import { Models } from '..';
|
||||
import { Models } from '../index';
|
||||
|
||||
const module = await createModule();
|
||||
const models = module.get(Models);
|
||||
|
||||
@@ -2,7 +2,7 @@ import test from 'ava';
|
||||
|
||||
import { createModule } from '../../__tests__/create-module';
|
||||
import { Mockers } from '../../__tests__/mocks';
|
||||
import { Models } from '..';
|
||||
import { Models } from '../index';
|
||||
|
||||
const module = await createModule();
|
||||
const models = module.get(Models);
|
||||
|
||||
@@ -2,7 +2,7 @@ import test from 'ava';
|
||||
|
||||
import { createModule } from '../../__tests__/create-module';
|
||||
import { Mockers } from '../../__tests__/mocks';
|
||||
import { Models } from '..';
|
||||
import { Models } from '../index';
|
||||
|
||||
const module = await createModule();
|
||||
const models = module.get(Models);
|
||||
|
||||
@@ -4,8 +4,8 @@ import test from 'ava';
|
||||
|
||||
import { createModule } from '../../__tests__/create-module';
|
||||
import { Mockers } from '../../__tests__/mocks';
|
||||
import { Models } from '..';
|
||||
import { CommentChangeAction, Reply } from '../comment';
|
||||
import { Models } from '../index';
|
||||
|
||||
const module = await createModule({});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import test from 'ava';
|
||||
|
||||
import { createModule } from '../../__tests__/create-module';
|
||||
import { Mockers } from '../../__tests__/mocks';
|
||||
import { Models } from '..';
|
||||
import { Models } from '../index';
|
||||
|
||||
const module = await createModule({});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ZodError } from 'zod';
|
||||
|
||||
import { createModule } from '../../__tests__/create-module';
|
||||
import { Mockers } from '../../__tests__/mocks';
|
||||
import { Models } from '..';
|
||||
import { Models } from '../index';
|
||||
|
||||
const module = await createModule();
|
||||
const models = module.get(Models);
|
||||
|
||||
@@ -9,7 +9,7 @@ import { CryptoHelper, GraphqlBadRequest, Mutex } from '../../../base';
|
||||
import { ConfigModule } from '../../../base/config';
|
||||
import { ServerConfigModule } from '../../../core/config';
|
||||
import { Models } from '../../../models';
|
||||
import { CalendarModule } from '..';
|
||||
import { CalendarModule } from '../index';
|
||||
import {
|
||||
CalDAVProvider,
|
||||
CalendarProviderFactory,
|
||||
|
||||
@@ -13,7 +13,7 @@ import type {
|
||||
UpsertCalendarSubscriptionInput,
|
||||
} from '../../../models';
|
||||
import { Models } from '../../../models';
|
||||
import { CalendarModule } from '..';
|
||||
import { CalendarModule } from '../index';
|
||||
import {
|
||||
CalendarProvider,
|
||||
CalendarProviderFactory,
|
||||
|
||||
@@ -4,8 +4,8 @@ import Sinon from 'sinon';
|
||||
import { createModule } from '../../../__tests__/create-module';
|
||||
import { Config } from '../../../base';
|
||||
import { ConfigModule } from '../../../base/config';
|
||||
import { IndexerModule } from '..';
|
||||
import { IndexerEvent } from '../event';
|
||||
import { IndexerModule } from '../index';
|
||||
|
||||
const module = await createModule({
|
||||
imports: [
|
||||
|
||||
@@ -10,8 +10,8 @@ import { JOB_SIGNAL } from '../../../base';
|
||||
import { ConfigModule } from '../../../base/config';
|
||||
import { ServerConfigModule } from '../../../core/config';
|
||||
import { Models } from '../../../models';
|
||||
import { IndexerModule, IndexerService } from '..';
|
||||
import { SearchProviderFactory } from '../factory';
|
||||
import { IndexerModule, IndexerService } from '../index';
|
||||
import { IndexerJob } from '../job';
|
||||
import { ManticoresearchProvider } from '../providers';
|
||||
|
||||
|
||||
+1
-1
@@ -12,8 +12,8 @@ import {
|
||||
import { Mockers } from '../../../../__tests__/mocks';
|
||||
import { ConfigModule } from '../../../../base/config';
|
||||
import { User, Workspace } from '../../../../models';
|
||||
import { IndexerModule } from '../../';
|
||||
import { SearchProviderType } from '../../config';
|
||||
import { IndexerModule } from '../../index';
|
||||
import { AggregateQueryDSL, ElasticsearchProvider } from '../../providers';
|
||||
import { blockMapping, docMapping, SearchTable } from '../../tables';
|
||||
|
||||
|
||||
+1
-1
@@ -8,8 +8,8 @@ import { omit } from 'lodash-es';
|
||||
import { createModule } from '../../../../__tests__/create-module';
|
||||
import { Mockers } from '../../../../__tests__/mocks';
|
||||
import { ConfigModule } from '../../../../base/config';
|
||||
import { IndexerModule } from '../../';
|
||||
import { SearchProviderType } from '../../config';
|
||||
import { IndexerModule } from '../../index';
|
||||
import { ManticoresearchProvider } from '../../providers';
|
||||
import { blockSQL, docSQL, SearchTable } from '../../tables';
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import { createModule } from '../../../__tests__/create-module';
|
||||
import { Mockers } from '../../../__tests__/mocks';
|
||||
import { ConfigModule } from '../../../base/config';
|
||||
import { ServerConfigModule } from '../../../core/config';
|
||||
import { IndexerModule, IndexerService } from '..';
|
||||
import { SearchProviderFactory } from '../factory';
|
||||
import { IndexerModule, IndexerService } from '../index';
|
||||
import { ManticoresearchProvider } from '../providers';
|
||||
import { UpsertDoc } from '../service';
|
||||
import { SearchTable } from '../tables';
|
||||
|
||||
Reference in New Issue
Block a user