@email-kit/cli 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 email-kit contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,125 @@
1
- # Temporary Holding Version
1
+ # email-kit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Type-safe email templates for TypeScript backends. Write the emails your app sends in TSX with
4
+ themed, email-safe components. `email-kit compile` turns them into a small typed module your server
5
+ imports, and `email-kit check` checks every one for email clients, dark mode, accessibility and
6
+ copy.
7
+
8
+ **[Documentation](https://email-kit.dev)** · [Getting started](https://email-kit.dev/guide/getting-started/) · [GitHub](https://github.com/email-kit/email-kit)
9
+
10
+ ## Get started
11
+
12
+ In the project that sends email (in a monorepo, the app's folder), run:
13
+
14
+ ```sh
15
+ npm create email-kit
16
+ ```
17
+
18
+ It detects your package manager, TypeScript setup and framework, installs the packages below, adds
19
+ a config and a welcome template, and compiles once. It asks before changing any file you already
20
+ have; `npm create email-kit -- --yes` accepts every default, as in CI. `npx @email-kit/cli init`
21
+ does the same.
22
+
23
+ Then render the welcome email from your server, with the import `init` prints for your project:
24
+
25
+ ```ts
26
+ import { emails } from "./email-kit"
27
+
28
+ const { subject, html, text } = emails.welcome.render({
29
+ name: "Ada",
30
+ plan: "pro",
31
+ startUrl: "https://example.com/start",
32
+ })
33
+ ```
34
+
35
+ email-kit doesn't send email: hand `subject`, `html` and `text` to any provider's API.
36
+
37
+ While you work:
38
+
39
+ ```sh
40
+ npx email-kit compile # after changing a template or message; --watch keeps it running
41
+ npx email-kit check # the checks; exits 1 on errors, for CI
42
+ npx email-kit new <id> # another template, with messages in every locale
43
+ ```
44
+
45
+ The [getting started guide](https://email-kit.dev/guide/getting-started/) goes through it step by
46
+ step, and [your first email](https://email-kit.dev/guide/first-email/) builds one from scratch.
47
+
48
+ ## A template
49
+
50
+ Each template is a folder with `template.tsx` and a `messages.<locale>.json` per language:
51
+
52
+ ```tsx
53
+ import { Button, Heading, Text } from "@email-kit/components"
54
+ import { defineEmail, url } from "@email-kit/core"
55
+ import { z } from "zod"
56
+
57
+ export default defineEmail({
58
+ id: "welcome",
59
+ purpose: "transactional",
60
+ schema: z.object({ name: z.string().min(1), startUrl: z.string().meta(url) }),
61
+ subject: (data, t) => t("subject", { name: data.name }),
62
+ fixtures: { default: { name: "Ada", startUrl: "https://example.com/start" } },
63
+ component: ({ data, t }) => (
64
+ <>
65
+ <Heading>{t("heading", { name: data.name })}</Heading>
66
+ <Text>{t("body")}</Text>
67
+ <Button href={data.startUrl}>{t("cta")}</Button>
68
+ </>
69
+ ),
70
+ })
71
+ ```
72
+
73
+ Templates run when you compile, not when you send: your server imports the generated module, which
74
+ needs only `@email-kit/runtime`.
75
+
76
+ ## The packages
77
+
78
+ They work together and are released together: install the same version of each.
79
+ `npm create email-kit` installs them for you.
80
+
81
+ | Package | What it is | Install as |
82
+ |---|---|---|
83
+ | [`create-email-kit`](https://www.npmjs.com/package/create-email-kit) | `npm create email-kit`: runs `email-kit init` in the folder you're in | not installed |
84
+ | [`@email-kit/cli`](https://www.npmjs.com/package/@email-kit/cli) | The `email-kit` command: `init`, `new`, `compile`, `check` and `tokens` | devDependency |
85
+ | [`@email-kit/core`](https://www.npmjs.com/package/@email-kit/core) | What templates are written with: `defineEmail`, the JSX runtime, `If`/`Each`/`Unless`, field markers (`url`, `secret`, `formatted`), `defineConfig` and `defineCheck` | devDependency |
86
+ | [`@email-kit/components`](https://www.npmjs.com/package/@email-kit/components) | Email-safe components themed from your shadcn CSS or design tokens: `Text`, `Heading`, `Link`, `Button`, `Image`, `Divider`, `Spacer`, `Section`, `List`, `KeyValue`, `Callout`, `OtpCode`, `DataTable`, `LineItems` and `Footer` | devDependency |
87
+ | [`@email-kit/runtime`](https://www.npmjs.com/package/@email-kit/runtime) | Renders the compiled emails. The only one your app needs when it runs | **dependency** |
88
+
89
+ ### The runtime
90
+
91
+ `@email-kit/runtime` has no dependencies and uses only web-standard APIs, so it runs in Node 22+,
92
+ Bun, Deno, Cloudflare Workers, AWS Lambda and Next.js server code. You don't import it yourself:
93
+ the generated module does, and only the entry points your templates use, from about 1.4 KB to 3 KB
94
+ min+gzip:
95
+
96
+ | Entry point | Imported when |
97
+ |---|---|
98
+ | `@email-kit/runtime` | always |
99
+ | `@email-kit/runtime/validate` | `validate` is on (the default) |
100
+ | `@email-kit/runtime/plural` | a message has a plural or a select |
101
+ | `@email-kit/runtime/locale` | the project compiles more than one locale |
102
+ | `@email-kit/runtime/context` | the config has sender values passed at send time |
103
+
104
+ Rendering problems throw an `EmailRenderError` with a `code`; see the
105
+ [error reference](https://email-kit.dev/reference/errors/). A module compiled by another version of
106
+ the CLI fails with `incompatible-module` rather than rendering wrong.
107
+
108
+ ## Status
109
+
110
+ **1.0.** Stable for transactional email; breaking changes come only in a major release. Not yet:
111
+ marketing email (unsubscribe links, multi-column layouts), testing in real email clients (classic
112
+ Outlook especially), and the preview studio.
113
+
114
+ ## More
115
+
116
+ - [Guide](https://email-kit.dev/guide/): templates, components, messages and locales, theme and dark
117
+ mode, checks and CI, rendering and sending.
118
+ - Reference: [CLI](https://email-kit.dev/reference/cli/),
119
+ [configuration](https://email-kit.dev/reference/configuration/),
120
+ [checks](https://email-kit.dev/reference/checks/), [errors](https://email-kit.dev/reference/errors/).
121
+ - [Issues](https://github.com/email-kit/email-kit/issues) and
122
+ [changelog](https://github.com/email-kit/email-kit/blob/main/packages/cli/CHANGELOG.md).
123
+
124
+ The CLI requires Node.js 22.12 or later. MIT licensed; the CLI's third-party notices are in its
125
+ `THIRD_PARTY_NOTICES.md`.
@@ -0,0 +1,83 @@
1
+ # Third-party notices
2
+
3
+ `@email-kit/cli` is MIT licensed (see LICENSE). It includes material from the projects below.
4
+
5
+ ## Unicode CLDR
6
+
7
+ `dist/cli.js` bundles data from the Unicode Common Locale Data Repository (CLDR) 47, through the
8
+ `cldr-core` package: plural rules (`supplemental/plurals.json`), parent locales
9
+ (`supplemental/parentLocales.json`) and likely subtags (`supplemental/likelySubtags.json`). Modules
10
+ that `email-kit compile` generates contain plural-rule functions and locale data derived from it.
11
+
12
+ ```
13
+ UNICODE LICENSE V3
14
+
15
+ COPYRIGHT AND PERMISSION NOTICE
16
+
17
+ Copyright © 2004-2025 Unicode, Inc.
18
+
19
+ NOTICE TO USER: Carefully read the following legal agreement. BY
20
+ DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
21
+ SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
22
+ TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
23
+ DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining a
26
+ copy of data files and any associated documentation (the "Data Files") or
27
+ software and any associated documentation (the "Software") to deal in the
28
+ Data Files or Software without restriction, including without limitation
29
+ the rights to use, copy, modify, merge, publish, distribute, and/or sell
30
+ copies of the Data Files or Software, and to permit persons to whom the
31
+ Data Files or Software are furnished to do so, provided that either (a)
32
+ this copyright and permission notice appear with all copies of the Data
33
+ Files or Software, or (b) this copyright and permission notice appear in
34
+ associated Documentation.
35
+
36
+ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
37
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
39
+ THIRD PARTY RIGHTS.
40
+
41
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
42
+ BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
43
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
46
+ FILES OR SOFTWARE.
47
+
48
+ Except as contained in this notice, the name of a copyright holder shall
49
+ not be used in advertising or otherwise to promote the sale, use or other
50
+ dealings in these Data Files or Software without prior written
51
+ authorization of the copyright holder.
52
+
53
+ SPDX-License-Identifier: Unicode-3.0
54
+ ```
55
+
56
+ ## shadcn/ui
57
+
58
+ The built-in default theme adapts the colour values of shadcn/ui's neutral theme
59
+ (https://github.com/shadcn-ui/ui), and `email-kit` reads shadcn theme files.
60
+
61
+ ```
62
+ MIT License
63
+
64
+ Copyright (c) 2023 shadcn
65
+
66
+ Permission is hereby granted, free of charge, to any person obtaining a copy
67
+ of this software and associated documentation files (the "Software"), to deal
68
+ in the Software without restriction, including without limitation the rights
69
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
70
+ copies of the Software, and to permit persons to whom the Software is
71
+ furnished to do so, subject to the following conditions:
72
+
73
+ The above copyright notice and this permission notice shall be included in all
74
+ copies or substantial portions of the Software.
75
+
76
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
77
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
78
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
79
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
80
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
81
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
82
+ SOFTWARE.
83
+ ```