fix: estabiliza templates de e-mail no CI

- Usa @react-email/components nos templates para evitar módulos ausentes no Bun 1.3.1\n- Ajusta preload do bun test para expor global Element (evita crash do PrismJS)
This commit is contained in:
esdrasrenan 2025-12-13 21:06:06 -03:00
parent 88a9ef454e
commit 548c2e44d4
5 changed files with 12 additions and 20 deletions

View file

@ -1,12 +1,5 @@
import * as React from "react" import * as React from "react"
import { Body } from "@react-email/body" import { Body, Container, Head, Html, Img, Preview, Section, Text } from "@react-email/components"
import { Container } from "@react-email/container"
import { Head } from "@react-email/head"
import { Html } from "@react-email/html"
import { Img } from "@react-email/img"
import { Preview } from "@react-email/preview"
import { Section } from "@react-email/section"
import { Text } from "@react-email/text"
import { EMAIL_COLORS } from "./tokens" import { EMAIL_COLORS } from "./tokens"
import { getEmailAssetUrl } from "./utils" import { getEmailAssetUrl } from "./utils"

View file

@ -1,6 +1,5 @@
import * as React from "react" import * as React from "react"
import { Section } from "@react-email/section" import { Section, Text } from "@react-email/components"
import { Text } from "@react-email/text"
import { EMAIL_COLORS } from "./tokens" import { EMAIL_COLORS } from "./tokens"
import { formatPriority, formatStatus } from "./utils" import { formatPriority, formatStatus } from "./utils"

View file

@ -1,9 +1,5 @@
import * as React from "react" import * as React from "react"
import { Button } from "@react-email/button" import { Button, Heading, Hr, Section, Text } from "@react-email/components"
import { Heading } from "@react-email/heading"
import { Hr } from "@react-email/hr"
import { Section } from "@react-email/section"
import { Text } from "@react-email/text"
import { RavenEmailLayout } from "./_components/layout" import { RavenEmailLayout } from "./_components/layout"
import { EMAIL_COLORS } from "./_components/tokens" import { EMAIL_COLORS } from "./_components/tokens"

View file

@ -1,9 +1,5 @@
import * as React from "react" import * as React from "react"
import { Button } from "@react-email/button" import { Button, Heading, Hr, Section, Text } from "@react-email/components"
import { Heading } from "@react-email/heading"
import { Hr } from "@react-email/hr"
import { Section } from "@react-email/section"
import { Text } from "@react-email/text"
import { RavenEmailLayout } from "./_components/layout" import { RavenEmailLayout } from "./_components/layout"
import { EMAIL_COLORS } from "./_components/tokens" import { EMAIL_COLORS } from "./_components/tokens"

View file

@ -33,6 +33,14 @@ if (typeof window === "undefined" || typeof document === "undefined") {
} }
} }
const globalTarget = globalThis as Record<string, unknown>
if (typeof globalTarget.Element === "undefined") {
const win = globalTarget.window as undefined | { Element?: unknown }
if (win?.Element) {
globalTarget.Element = win.Element
}
}
const applyFixedDate = () => { const applyFixedDate = () => {
if (fixedTimestamp === null) { if (fixedTimestamp === null) {
globalThis.Date = OriginalDate globalThis.Date = OriginalDate