@nxgt/mail-i18n 0.3.0 → 0.3.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/README.md CHANGED
@@ -407,7 +407,9 @@ the build.
407
407
  **List the plugin that brings a template's components.** A tag that
408
408
  resolves to no component renders nothing, and the build fails with
409
409
  `i18n: fr/welcome.html is empty — a tag of its template resolved to no
410
- component; list the plugin that brings it, as ui()`.
410
+ component; list the plugin that brings it, as ui()`. With `ui()` listed, a
411
+ tag that resolves to no component fails the build first, nested or not:
412
+ `ui: <NxButon> in emails/welcome.vue is no component — …`.
411
413
 
412
414
  **Leave the output paths to the plugin.** An `output.path` set in a
413
415
  template, or a `plaintext.destination`, moves a file out of the plugin's
@@ -229,7 +229,7 @@ catalogues, not a condition to catch:
229
229
  | `i18n: en: welcome.subject uses {count} as a number — a subject's arguments are placeholders, filled at send time as strings` | A subject with a `number`, `plural` or `date` argument |
230
230
  | `i18n: en: welcome.subject chooses on {kind} with a select — a subject's arguments are placeholders, which always choose other` | A subject with a `select` argument |
231
231
  | `i18n: welcome was not built in fr` | No HTML file (with `output.extension`) was written for that e-mail in that locale |
232
- | `i18n: fr/welcome.html is empty — a tag of its template resolved to no component; list the plugin that brings it, as ui()` | The file holds nothing but its doctype: a tag of the template matched no component, which Vue renders as nothing. See [Templates from a package](templates.md#templates-from-a-package) |
232
+ | `i18n: fr/welcome.html is empty — a tag of its template resolved to no component; list the plugin that brings it, as ui()` | The file holds nothing but its doctype: a tag of the template matched no component, which Vue renders as nothing. With `ui()` listed, the build fails earlier on `ui: <Tag> in <file> is no component`. See [Templates from a package](templates.md#templates-from-a-package) |
233
233
  | `i18n: ../text/welcome.en.txt was written outside the output folder — the i18n plugin lays out every e-mail; set no plaintext.destination and no output path in a template` | A `plaintext.destination`, or an output path set in a template, put a file outside `output.path` |
234
234
  | `i18n: custom/welcome.html is not where the i18n plugin puts an e-mail — set no output path in a template` | A file in the output folder that is not `<locale>/<email>` (or `<email>.<locale>` with the flat layout), usually from an output path set in a template |
235
235
 
@@ -266,7 +266,9 @@ which skips that folder. The plugin that ships the components resolves them —
266
266
  `@nxgt/mail-ui`'s `ui()` does, for its `Nx*` components and Maizzle's
267
267
  built-ins, so list it in `plugins`. A tag left unresolved renders nothing,
268
268
  and the build fails on the empty e-mail (see
269
- [What fails the build](#what-fails-the-build)).
269
+ [What fails the build](#what-fails-the-build)); with `ui()` listed, one
270
+ nested anywhere fails it too, naming the tag and the file:
271
+ `ui: <NxButon> in emails/welcome.vue is no component — …`.
270
272
 
271
273
  ### Its errors
272
274
 
@@ -302,7 +304,7 @@ the template or the catalogues, to fix, not a condition to catch.
302
304
  | `i18n: templates[0] has no template sign-in.vue — name one of its e-mails` | A [package's source](#templates-from-a-package) lists, in `emails`, a template its folder does not have; checked when the config loads |
303
305
  | `i18n: templates[0] holds no template — is /…/emails the folder of a package's e-mails?` | A package's source whose `dir` is missing or has no template; checked when the config loads |
304
306
  | `i18n: templates[0] and templates[1] both have welcome.vue — keep one with emails: [...], or write the project's own in its folder` | Two package sources ship the same e-mail; checked when the config loads |
305
- | `i18n: fr/welcome.html is empty — a tag of its template resolved to no component; list the plugin that brings it, as ui()` | The e-mail rendered nothing but the doctype: a tag of its template, usually the layout, matched no component, and Vue renders an unknown component as nothing. Typically `ui()` is missing from `plugins`, or a package's template uses a component no plugin brings. Reported when the manifest is written |
307
+ | `i18n: fr/welcome.html is empty — a tag of its template resolved to no component; list the plugin that brings it, as ui()` | The e-mail rendered nothing but the doctype: a tag of its template, usually the layout, matched no component, and Vue renders an unknown component as nothing. Typically `ui()` is missing from `plugins`, or a package's template uses a component no plugin brings. Reported when the manifest is written; with `ui()` listed, the build fails earlier on `ui: <Tag> in <file> is no component` |
306
308
  | `i18n: emails/Welcome.vue is not a kebab-case name — name a template as verify-email.vue` | A template whose path is not kebab-case, checked when the config loads. Under `maizzle serve`, one added while the server runs is printed with `console.error`, and the server keeps running |
307
309
  | `i18n: welcome has no subject — add welcome.subject to the catalogues` | The e-mail has no subject message; reported when the manifest is written, at the end of the build. The other manifest failures, including an output path set in a template, are in [The manifest](manifest.md#where-it-is-written) |
308
310
  | `i18n: emails/verify-email.vue is not built through the i18n plugin — leave content to it, and put templates in emails/` | Maizzle rendered a template directly: the project set its own `content` |
package/docs/roadmap.md CHANGED
@@ -5,10 +5,7 @@ no dates here, and the version something shipped in is the only number.
5
5
 
6
6
  ## Now
7
7
 
8
- - **The manifest's format, versioned** — `mail-manifest.json` starts with
9
- `formatVersion`, `MANIFEST_FORMAT` is exported, and the format changes only
10
- with the manifest's shape: any later `@nxgt/mail` 0.x reads the build.
11
- Built, not yet published.
8
+ Nothing between releases.
12
9
 
13
10
  ## Next
14
11
 
@@ -41,6 +38,10 @@ Nothing yet. A request is welcome as an
41
38
  The last ten, newest first, each with the version it came in. Everything
42
39
  before is in the [CHANGELOG](../CHANGELOG.md).
43
40
 
41
+ - **The manifest's format, versioned, v0.3.0** — `mail-manifest.json` starts
42
+ with `formatVersion`, `MANIFEST_FORMAT` is exported, and the format changes
43
+ only with the manifest's shape: any later `@nxgt/mail` 0.x reads the build.
44
+ The `@nxgt/mail-config` peer moves to `^0.2.0`.
44
45
  - **The wrappers under `.maizzle/emails/`, v0.2.0** — the files generated per
45
46
  template and locale move from `.maizzle/i18n/` to `.maizzle/emails/`, so
46
47
  `maizzle serve` lists the e-mails under `.maizzle/emails/en` rather than a
@@ -85,10 +86,3 @@ before is in the [CHANGELOG](../CHANGELOG.md).
85
86
  catalogues each time the config loads, so an editor completes `t('…')` and
86
87
  flags an unknown key or a wrong argument, and `vue-tsc` checks templates in
87
88
  CI.
88
- - **The renderer typed by the build, v0.1.0** — after each `maizzle build`, the
89
- plugin writes `generated/mail.ts`: `MailEmails`, each e-mail with the
90
- variables it takes, a URL variable as a `string`. With it,
91
- `createMailRenderer<MailEmails>` from `@nxgt/mail/renderer` refuses an
92
- unknown e-mail, a missing or unknown variable, or a number for a URL at
93
- compile time. Rewritten only when it changes;
94
- `rendererTypes` moves it, or `false` turns it off.
@@ -828,9 +828,12 @@ such warning for each tag that did not resolve.
828
828
 
829
829
  **When:** `maizzle build`, after the templates, when a template's outermost
830
830
  tag is a component that nothing resolves. Most often `ui()` is missing from
831
- the plugins while a template uses `<NxLayout>`. It also happens when a
832
- package's template, under `node_modules`, uses a component that no plugin in
833
- the list resolves for it.
831
+ the plugins while a template uses `<NxLayout>`, or a package's template,
832
+ under `node_modules`, uses a component that no plugin in the list resolves
833
+ for it. With `@nxgt/mail-ui`'s `ui()` listed, the build stops earlier, on
834
+ `ui: <NxLayout> in emails/welcome.vue is no component — check its name, or add
835
+ the plugin or the components folder that brings it`, for any tag nested or
836
+ not.
834
837
  **Why:** Vue renders a component it cannot resolve as nothing, and Maizzle
835
838
  still writes the file, with its doctype alone. The e-mail would go out
836
839
  blank, so the build stops.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/mail-i18n",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "An i18n plugin for a Maizzle project: ICU catalogues checked at build time, t() in templates, one output per locale, and the manifest the renderer reads. createTranslator for use outside templates.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,14 +52,14 @@
52
52
  "devDependencies": {
53
53
  "@maizzle/framework": "6.1.7",
54
54
  "@maizzle/tailwindcss": "1.5.6",
55
- "@nxgt/mail-config": "0.2.0",
55
+ "@nxgt/mail-config": "0.2.1",
56
56
  "@types/bun": "^1.4.2",
57
57
  "vue": "3.5.43",
58
58
  "vue-tsc": "^3.3.11"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@maizzle/framework": "^6.1.7",
62
- "@nxgt/mail-config": "^0.2.0",
62
+ "@nxgt/mail-config": "^0.2.1",
63
63
  "typescript": "^6.0.3",
64
64
  "vue": "^3.5.0"
65
65
  },