refactor(server): config system (#11081)

This commit is contained in:
forehalo
2025-03-27 12:32:28 +00:00
parent 7091111f85
commit 0ea38680fa
274 changed files with 7583 additions and 5841 deletions
@@ -195,7 +195,7 @@ export function Template(props: PropsWithChildren) {
</>
);
if (typeof AFFiNE !== 'undefined' && AFFiNE.node.test) {
if (env.testing) {
return content;
}
+2 -2
View File
@@ -41,7 +41,7 @@ type EmailContent = {
function render(component: React.ReactElement) {
return rawRender(component, {
pretty: AFFiNE.node.test,
pretty: env.testing,
});
}
@@ -53,7 +53,7 @@ function make<T extends React.ComponentType<any>>(
subject: string | ((props: Props<T>) => string)
): EmailRenderer<Props<T>> {
return async props => {
if (!props && AFFiNE.node.test) {
if (!props && env.testing) {
// @ts-expect-error test only
props = Component.PreviewProps;
}