mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-22 04:21:40 +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:
@@ -96,9 +96,7 @@
|
||||
"is-mobile": "^5.0.0",
|
||||
"jose": "^6.1.3",
|
||||
"jsonwebtoken": "^9.0.3",
|
||||
"keyv": "^5.2.2",
|
||||
"lodash-es": "^4.17.23",
|
||||
"mixpanel": "^0.18.0",
|
||||
"mustache": "^4.2.0",
|
||||
"nanoid": "^5.1.6",
|
||||
"nest-commander": "^3.15.0",
|
||||
@@ -136,7 +134,6 @@
|
||||
"@types/http-errors": "^2.0.4",
|
||||
"@types/jsonwebtoken": "^9.0.9",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/mixpanel": "^2.14.9",
|
||||
"@types/mustache": "^4.2.5",
|
||||
"@types/node": "^22.0.0",
|
||||
"@types/nodemailer": "^7.0.0",
|
||||
@@ -153,8 +150,7 @@
|
||||
"sinon": "^21.0.1",
|
||||
"socket.io-client": "^4.8.3",
|
||||
"supertest": "^7.1.4",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.7.2",
|
||||
"typescript": "^5.9.3",
|
||||
"why-is-node-running": "^3.2.2"
|
||||
},
|
||||
"nodemonConfig": {
|
||||
|
||||
@@ -342,7 +342,6 @@ await prunePrismaEngines(APP_ROOT, targetKey);
|
||||
|
||||
await Promise.all([
|
||||
rmrf(path.join(APP_ROOT, 'node_modules', 'typescript')).catch(() => {}),
|
||||
rmrf(path.join(APP_ROOT, 'node_modules', 'ts-node')).catch(() => {}),
|
||||
rmrf(path.join(APP_ROOT, 'node_modules', '@types')).catch(() => {}),
|
||||
rmrf(path.join(APP_ROOT, 'src')).catch(() => {}),
|
||||
rmrf(path.join(APP_ROOT, '.gitignore')).catch(() => {}),
|
||||
|
||||
@@ -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