Skip to content

Commit 5c9be99

Browse files
committed
chore: deps and stuff, tailwind 4
1 parent 7afe067 commit 5c9be99

File tree

7 files changed

+95
-67
lines changed

7 files changed

+95
-67
lines changed

.github/actions/setup/action.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ runs:
1818

1919
- name: Install PNPM
2020
uses: pnpm/action-setup@v4
21+
with:
22+
version: 9.15.9
2123

2224
- name: Sanity Check
2325
shell: bash

.moon/toolchain.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ node:
1414

1515
# The version of the package manager (above) to use.
1616
pnpm:
17-
version: '9.15.6'
17+
version: '9.15.9'
1818

1919
# Add `node.version` as a constraint in the root `package.json` `engines`.
2020
addEnginesConstraint: true

.npmrc

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
22
auth-type=legacy
3+
4+
# pnpm
5+
enable-pre-post-scripts=true
6+
shamefully-hoist=true

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"devDependencies": {
1010
"@dot/versioner": "^0.4.2",
11-
"@moonrepo/cli": "1.30.0",
11+
"@moonrepo/cli": "1.35.0",
1212
"@swc/core": "^1.3.91",
1313
"@swc/helpers": "^0.5.2",
1414
"@types/node": "22.14.1",
@@ -45,7 +45,7 @@
4545
"prettier --write"
4646
]
4747
},
48-
"packageManager": "pnpm@10.8.1",
48+
"packageManager": "pnpm@9.15.9",
4949
"pnpm": {
5050
"overrides": {
5151
"@types/react": "19.1.2",

packages/jsx-email/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
"@unocss/core": "^66.0.0",
6767
"@unocss/preset-rem-to-px": "^66.0.0",
6868
"@unocss/preset-typography": "^66.0.0",
69-
"@unocss/preset-uno": "^66.0.0",
70-
"@unocss/preset-wind": "^66.0.0",
69+
"@unocss/preset-wind3": "^66.0.0",
70+
"@unocss/preset-wind4": "66.1.0-beta.11",
7171
"@unocss/transformer-compile-class": "^66.0.0",
7272
"@unocss/transformer-variant-group": "^66.0.0",
7373
"@vitejs/plugin-react": "^4.3.0",

packages/jsx-email/src/components/tailwind/tailwind.tsx

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { ConfigBase } from '@unocss/core';
22
import { createGenerator } from '@unocss/core';
33
import { presetTypography } from '@unocss/preset-typography';
4-
import { presetWind } from '@unocss/preset-wind';
5-
import { presetUno } from '@unocss/preset-uno';
4+
import { presetWind3 } from '@unocss/preset-wind3';
5+
import { presetWind4 } from '@unocss/preset-wind4';
66
import { presetRemToPx } from '@unocss/preset-rem-to-px';
77
import transformerCompileClass from '@unocss/transformer-compile-class';
88
import transformerVariantGroup from '@unocss/transformer-variant-group';
@@ -26,11 +26,19 @@ export interface TailwindProps {
2626
'layers' | 'presets' | 'rules' | 'separators' | 'shortcuts' | 'theme' | 'variants'
2727
>;
2828
production?: boolean;
29+
version?: '3' | '4';
30+
}
31+
32+
interface GetUnoOptions {
33+
config: ConfigBase;
34+
production: boolean;
35+
version: '3' | '4';
2936
}
3037

3138
const debugProps = debug.elements.enabled ? { dataType: 'jsx-email/tailwind' } : {};
3239

33-
const getUno = async (config: ConfigBase, production: boolean) => {
40+
const getUno = async (options: GetUnoOptions) => {
41+
const { config, production, version } = options;
3442
const transformers = [transformerVariantGroup()];
3543

3644
if (production)
@@ -55,8 +63,7 @@ const getUno = async (config: ConfigBase, production: boolean) => {
5563
// Convert all `rem` values to `px`
5664
presetRemToPx(),
5765
presetTypography(),
58-
presetUno({ dark: 'media' }),
59-
presetWind()
66+
version === '3' ? presetWind3({ dark: 'media' }) : presetWind4({ dark: 'media' })
6067
];
6168
const uno = await createGenerator({
6269
...(config as any),
@@ -70,9 +77,10 @@ const getUno = async (config: ConfigBase, production: boolean) => {
7077
const render = async ({
7178
children,
7279
config = {},
73-
production = false
80+
production = false,
81+
version = '3'
7482
}: React.PropsWithChildren<TailwindProps>) => {
75-
const uno = await getUno(config, production);
83+
const uno = await getUno({ config, production, version });
7684
const html = await jsxToString(<>{children}</>);
7785
const code = production ? html.replace(/class="/g, 'class=":jsx: ') : html;
7886
const s = new MagicString(code);

pnpm-lock.yaml

+69-55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)