feat(server): improve ci build (#15386)

#### PR Dependency Tree


* **PR #15386** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved email rendering and formatting consistency.
* Preserved calendar synchronization windows while removing reliance on
date utility libraries.
* Enhanced cleanup of Prisma engine files, including deduplication and
space-saving reporting.

* **Tests**
  * Updated email snapshots to validate formatted HTML output.

* **Refactor**
* Streamlined email component usage and centralized email rendering
behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2026-07-31 17:07:05 +08:00
committed by GitHub
parent 5c38f1376c
commit 758b2260f8
11 changed files with 194 additions and 304 deletions
@@ -3,7 +3,6 @@ import { randomUUID } from 'node:crypto';
import { Injectable, Logger } from '@nestjs/common';
import { Transactional } from '@nestjs-cls/transactional';
import type { CalendarAccount, Prisma } from '@prisma/client';
import { addDays, subDays } from 'date-fns';
import {
CalendarProviderRequestError,
@@ -819,9 +818,14 @@ export class CalendarService {
private getSyncWindow() {
const now = this.now();
const timeMin = new Date(now);
const timeMax = new Date(now);
timeMin.setDate(timeMin.getDate() - DEFAULT_PAST_DAYS);
timeMax.setDate(timeMax.getDate() + DEFAULT_FUTURE_DAYS);
return {
timeMin: subDays(now, DEFAULT_PAST_DAYS).toISOString(),
timeMax: addDays(now, DEFAULT_FUTURE_DAYS).toISOString(),
timeMin: timeMin.toISOString(),
timeMax: timeMax.toISOString(),
};
}