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:
DarkSky
2026-02-24 13:22:46 +08:00
committed by GitHub
parent c2c7dde06c
commit 046e126054
48 changed files with 371 additions and 402 deletions
+5 -4
View File
@@ -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)),
};
};
}