Skip to content

Commit 64d30db

Browse files
committed
Fixed all open issues for a minor version bump (2.0.1)
1 parent 7b63889 commit 64d30db

File tree

11 files changed

+183
-149
lines changed

11 files changed

+183
-149
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
/build
44
/.svelte-kit
55
/package
6+
/dist
67
.env
78
.env.*
89
!.env.example

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 2.1.0 (2025-15-02)
2+
3+
## Minor Issues
4+
5+
- Made function param of `svelteEmailTailwind` optional, since all keys of the object param are optional too.
6+
- Removed 'pretty' dependency because it's no longer used in the render function since moving to Svelte's native `render`.
7+
- Moved back to the original html-to-text dependency instead of the forked package @steveninety/html-to-text. The patch of a Vite/import-related issue, which was the original reason for forking this package, seems to no longer be an issue in a later version of Vite.
8+
- Documented the `renderAsPlainText` function.
9+
- Renamed `Preview` to `PreviewInterface` in `/preview/PreviewInterface.svelte`, to distinguish the interface component from the email component that is also called 'Preview'. Decided (1) to not put it in the main entry point to keep it separate from email components and (2) to not give this version a major version bump because the PreviewInterface is not a production component - it's just used in development.
10+
- Updated the @sveltejs/package devDependency to V2 and adjusted the package.json accordingly. This should fix some type issues around imports.
11+
112
# 2.0.1 (2024-11-10)
213

314
## Patch
@@ -31,10 +42,12 @@ Move tw-to-css from dev dep to normal dep
3142
# 1.0.0 (2024-03-14)
3243

3344
## Features
45+
3446
- A Vite plugin to transform Tailwind classes on build-time.
3547
- Preview UI component has been added to the package (including corresponding server utility functions).
3648

3749
## BREAKING CHANGES
50+
3851
- The renderTailwind() function is now obsolete and has been removed. Use the Vite plugin instead.
3952
- The renderSvelte() function is replaced by Svelte's native render() function. Use the renderAsPlainText() function to turn a rendered component's html to plain text.
4053
- The `<Custom />` component is required to use Tailwind classes on custom html.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ This example uses [Resend](https://resend.com/docs/send-with-nodejs) to send the
118118

119119
```ts
120120
import { render } from 'svelte/server';
121+
// import { renderAsPlainText } from 'svelte-email-tailwind';
121122
import type { ComponentProps } from 'svelte';
122123
import type HelloProps from 'src/lib/emails/Hello.svelte';
123124
import Hello from 'src/lib/emails/Hello.svelte';
@@ -129,6 +130,8 @@ const componentProps: ComponentProps<HelloProps> = {
129130
};
130131

131132
const { html } = render(Hello, { props: componentProps });
133+
// Alternatively, render your email as plain text:
134+
// const plainText = renderAsPlainText(html);
132135

133136
const resend = new Resend(PRIVATE_RESEND_API_KEY);
134137

@@ -138,6 +141,8 @@ resend.emails.send({
138141
139142
subject: 'Hello',
140143
html: html
144+
// Or send your plain text:
145+
// html: plainText
141146
});
142147
```
143148

@@ -152,17 +157,17 @@ To get started...
152157

153158
## 1. Configure a route
154159

155-
Import the Preview component and pass in the server data as a prop. Customize the email address.
160+
Import the PreviewInterface component and pass in the server data as a prop. Customize the email address.
156161

157162
`src/routes/email-previews/+page.svelte`
158163

159164
```svelte
160165
<script lang="ts">
161-
import Preview from 'svelte-email-tailwind/preview/preview.svelte';
166+
import PreviewInterface from 'svelte-email-tailwind/preview/PreviewInterface.svelte';
162167
export let data;
163168
</script>
164169
165-
<Preview {data} email="[email protected]" />
170+
<PreviewInterface {data} email="[email protected]" />
166171
```
167172

168173
## 2. Configure the server for this route

package.json

Lines changed: 96 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,98 @@
11
{
2-
"name": "svelte-email-tailwind",
3-
"version": "2.0.1",
4-
"description": "Build emails with Svelte 5 and Tailwind",
5-
"author": {
6-
"name": "Steven Polak"
7-
},
8-
"contributors": [
9-
"Carsten Lebek"
10-
],
11-
"keywords": [
12-
"svelte",
13-
"email",
14-
"tailwind",
15-
"sveltekit",
16-
"resend"
17-
],
18-
"repository": {
19-
"type": "git",
20-
"url": "https://github.com/steveninety/svelte-email-tailwind.git",
21-
"homepage": "https://github.com/steveninety/svelte-email-tailwind#readme"
22-
},
23-
"scripts": {
24-
"dev": "vite dev",
25-
"package": "svelte-kit sync && svelte-package",
26-
"build": "vite build",
27-
"prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1",
28-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
29-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
30-
"lint": "prettier --plugin-search-dir . --check . && eslint .",
31-
"format": "prettier --plugin-search-dir . --write ."
32-
},
33-
"devDependencies": {
34-
"@sveltejs/adapter-auto": "^2.1.1",
35-
"@sveltejs/kit": "^1.27.4",
36-
"@sveltejs/package": "^1.0.2",
37-
"@types/html-to-text": "^9.0.4",
38-
"@types/pretty": "^2.0.3",
39-
"@typescript-eslint/eslint-plugin": "^5.62.0",
40-
"@typescript-eslint/parser": "^5.62.0",
41-
"autoprefixer": "^10.4.16",
42-
"clsx": "^1.2.1",
43-
"csstype": "^3.1.2",
44-
"eslint": "^8.53.0",
45-
"eslint-config-prettier": "^8.10.0",
46-
"eslint-plugin-svelte3": "^4.0.0",
47-
"postcss": "^8.4.31",
48-
"prettier": "^2.8.8",
49-
"prettier-plugin-svelte": "^2.10.1",
50-
"svelte-check": "^3.6.0",
51-
"tslib": "^2.6.2",
52-
"typescript": "^4.9.5",
53-
"vite": "^4.5.0",
54-
"vite-plugin-inspect": "^0.8.3"
55-
},
56-
"type": "module",
57-
"dependencies": {
58-
"@steveninety/html-to-text": "^9.0.5",
59-
"@sveltejs/vite-plugin-svelte": "^4.0.0",
60-
"pretty": "^2.0.0",
61-
"resend": "2.0.0",
62-
"svelte": "^5",
63-
"svelte-persisted-store": "^0.12.0",
64-
"tw-to-css": "0.0.12"
65-
}
2+
"name": "svelte-email-tailwind",
3+
"version": "2.1.0",
4+
"description": "Build emails with Svelte 5 and Tailwind",
5+
"author": {
6+
"name": "Steven Polak"
7+
},
8+
"contributors": [
9+
"Carsten Lebek"
10+
],
11+
"license": "MIT",
12+
"keywords": [
13+
"svelte",
14+
"email",
15+
"tailwind",
16+
"sveltekit",
17+
"resend"
18+
],
19+
"repository": {
20+
"type": "git",
21+
"url": "https://github.com/steveninety/svelte-email-tailwind.git",
22+
"homepage": "https://github.com/steveninety/svelte-email-tailwind#readme"
23+
},
24+
"scripts": {
25+
"dev": "vite dev",
26+
"package": "svelte-kit sync && svelte-package",
27+
"build": "vite build",
28+
"prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1",
29+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
30+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
31+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
32+
"format": "prettier --plugin-search-dir . --write ."
33+
},
34+
"devDependencies": {
35+
"@sveltejs/adapter-auto": "^2.1.1",
36+
"@sveltejs/package": "^2.3.10",
37+
"@types/html-to-text": "^9.0.4",
38+
"@typescript-eslint/eslint-plugin": "^5.62.0",
39+
"@typescript-eslint/parser": "^5.62.0",
40+
"autoprefixer": "^10.4.16",
41+
"clsx": "^1.2.1",
42+
"csstype": "^3.1.2",
43+
"eslint": "^8.53.0",
44+
"eslint-config-prettier": "^8.10.0",
45+
"eslint-plugin-svelte3": "^4.0.0",
46+
"postcss": "^8.4.31",
47+
"prettier": "^2.8.8",
48+
"prettier-plugin-svelte": "^2.10.1",
49+
"svelte-check": "^3.6.0",
50+
"tslib": "^2.6.2",
51+
"typescript": "^4.9.5",
52+
"vite": "^4.5.0",
53+
"vite-plugin-inspect": "^0.8.3"
54+
},
55+
"type": "module",
56+
"dependencies": {
57+
"@sveltejs/kit": "^1.30.4",
58+
"@sveltejs/vite-plugin-svelte": "^4.0.0",
59+
"html-to-text": "^9.0.5",
60+
"resend": "2.0.0",
61+
"svelte": "^5",
62+
"svelte-persisted-store": "^0.12.0",
63+
"tw-to-css": "0.0.12"
64+
},
65+
"files": [
66+
"dist"
67+
],
68+
"exports": {
69+
".": {
70+
"types": "./dist/index.d.ts",
71+
"svelte": "./dist/index.js",
72+
"default": "./dist/index.js"
73+
},
74+
"./package.json": "./package.json",
75+
"./components/Body.svelte": "./dist/components/Body.svelte",
76+
"./components/Button.svelte": "./dist/components/Button.svelte",
77+
"./components/Column.svelte": "./dist/components/Column.svelte",
78+
"./components/Container.svelte": "./dist/components/Container.svelte",
79+
"./components/Custom.svelte": "./dist/components/Custom.svelte",
80+
"./components/Head.svelte": "./dist/components/Head.svelte",
81+
"./components/Heading.svelte": "./dist/components/Heading.svelte",
82+
"./components/Hr.svelte": "./dist/components/Hr.svelte",
83+
"./components/Html.svelte": "./dist/components/Html.svelte",
84+
"./components/Img.svelte": "./dist/components/Img.svelte",
85+
"./components/Link.svelte": "./dist/components/Link.svelte",
86+
"./components/Preview.svelte": "./dist/components/Preview.svelte",
87+
"./components/Row.svelte": "./dist/components/Row.svelte",
88+
"./components/Section.svelte": "./dist/components/Section.svelte",
89+
"./components/Text.svelte": "./dist/components/Text.svelte",
90+
"./preview": "./dist/preview/index.js",
91+
"./preview/PreviewInterface.svelte": {
92+
"types": "./dist/preview/PreviewInterface.svelte.d.ts",
93+
"svelte": "./dist/preview/PreviewInterface.svelte"
94+
},
95+
"./utils": "./dist/utils/index.js",
96+
"./vite": "./dist/vite/index.js"
97+
}
6698
}

patches/[email protected]

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)