Skip to content

Conversation

@shellscape
Copy link
Owner

Component / Package Name:

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

Test dependency updates

@charliecreates charliecreates bot requested a review from CharlieHelps October 29, 2025 20:15
@shellscape shellscape merged commit 310bfb9 into main Oct 29, 2025
10 checks passed
@shellscape shellscape deleted the chore/repo/update-vite branch October 29, 2025 20:19
Copy link
Contributor

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • buffer as any in compile.ts unnecessarily discards type safety; use buffer.toString('utf8') or cast as Uint8Array for esbuild.transform instead.
  • Replacing --no-threads with --pool=forks may change test semantics; add --workers=1 if single-worker execution is desired for deterministic CLI tests.
  • The rest of the changes (Vitest config migration, snapshot updates, and task references) look consistent with the dependency upgrades.
Additional notes (1)
  • Maintainability | packages/jsx-email/package.json:100-100
    The lockfile currently includes multiple esbuild versions (e.g., 0.24.x and 0.25.x). The packages/jsx-email package still pins esbuild to ^0.24.0, which may be causing duplication and inconsistent typings across the repo. Aligning to a single modern esbuild version can reduce install size and avoid type drift.
Summary of changes
  • Bumped core tooling: TypeScript to ^5.9.3, Vitest to ^4.0.5, Vite to ^7.1.12, and @vitejs/plugin-react to ^5.1.0.
  • Migrated Vitest config from shared/vitest.config.ts to ESM shared/vitest.config.mts and updated all references (Moon tasks and docs/playbooks).
  • Updated test task flags for compatibility with Vitest 4 (using --pool=forks).
  • Large snapshot refresh to match new serializers/formatting from the upgraded test stack.
  • Minor code change in packages/jsx-email/src/renderer/compile.ts using buffer as any when calling esbuild.transform.
  • Synchronized ESLint TS config include to the new Vitest config filename.
  • pnpm lockfile updated to reflect the dependency bumps throughout the monorepo.

builder.onLoad({ filter: /\.css$/ }, async (args) => {
const buffer = await readFile(args.path);
const css = await esbuild.transform(buffer, { loader: 'css', minify: false });
const css = await esbuild.transform(buffer as any, { loader: 'css', minify: false });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using as any here; it suppresses type safety and can hide real issues. esbuild.transform accepts a string or Uint8Array, and readFile returns a Buffer (which is a Uint8Array). Prefer passing a proper type instead of erasing it.

Two safer options:

  • Convert to string explicitly (simplest for CSS): buffer.toString('utf8')
  • Cast to Uint8Array (no copy): buffer as Uint8Array

Converting to string is the clearest and avoids surprises with encoding-sensitive transforms.

Suggestion

Replace the any cast with a strongly-typed input to esbuild.transform.

Example:

const source = buffer.toString('utf8');
const css = await esbuild.transform(source, { loader: 'css', minify: false });

or, if you prefer not to allocate a string:

const css = await esbuild.transform(buffer as Uint8Array, { loader: 'css', minify: false });

Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.

Comment on lines +29 to +30
"typescript": "^5.9.3",
"vitest": "^4.0.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’ve upgraded to Vite 7 and @vitejs/plugin-react@5.1.0, which both require modern Node (Vite 7 requires Node >= 20.19). To prevent accidental CI or local runs on older Node versions, declare an explicit engines constraint at the repo root (and/or enforce via Volta/nvm).

Suggestion

Consider adding an engines field to the root package.json to enforce the minimum Node version required by Vite 7 and its plugins:

{
  "engines": {
    "node": ">=20.19.0"
  }
}

I can add this in a tiny follow-up commit if you’d like. Reply with "@CharlieHelps yes please" and I’ll push it.

@charliecreates charliecreates bot removed the request for review from CharlieHelps October 29, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants