@websolutespa/bom-mixer-emails 3.0.0 → 3.1.0

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/CHANGELOG.md CHANGED
@@ -1,13 +1,42 @@
1
- # @websolutespa/bom-mixer-emails
2
-
3
- ## 3.0.0
4
-
5
- ### Major Changes
6
-
7
- - Release: Bom 3.0
8
-
9
- ## 0.0.1
10
-
11
- ### Patch Changes
12
-
13
- - Added: first release
1
+ # @websolutespa/bom-mixer-emails
2
+
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3f7c21b: - Payload 3.91.0 and Next.js 16.4.2 (React 19.2.9): peer dependencies are now ranges, `payload` / `@payloadcms/*` `^3.91.0`, `next` `^16.3.3`, `react` / `react-dom` `^19.2.1`
8
+ - payload-plugin-bowl: the mixer context is built only for reads by an authenticated user (payload 3.90+ resolves the jwt user with the request query, populating tenants before `req.user` is set); email options typed with payload `SendEmailOptions`, no direct nodemailer dependency
9
+ - payload-plugin-storage: `AZURE_STORAGE_CONTAINER_ACCESS` (`private` default since payload 3.90, `blob`, `container`) for containers created by the plugin
10
+ - mixer web: `images.qualities` includes `IMAGE_QUALITY` (next 16 defaults to `[75]`)
11
+ - cef3bd8: - bom-mixer-emails: @react-email/components 1.0.12 and @react-email/render 2.1.1 (react 19); `renderEmail` is now async and returns `Promise<string>`
12
+ - payload-plugin-bowl-llm: openai 7.42.0 (zod 4), @modelcontextprotocol/sdk 1.32.1
13
+ - bom-cli: openai 7.42.0 client (`chat.completions`, `completions`)
14
+ - sonner 2.0.8
15
+
16
+ ### Patch Changes
17
+
18
+ - d88019f: - library majors: uuid 14, marked 18 (llm text renderer ported to token renderers), mime 4, mime-types 3, iron-session 9, node-cron 4, html-to-text 10, react-error-boundary 6, react-dropzone 20 (import modal accepts `text/csv` `.csv`), fast-equals 6, schema-dts 2, json-schema-typed 9, dotenv 18 (quiet), chalk 6, giget 3, @clack/prompts 1, keeper secrets manager 17
19
+ - 12b6e2f: - test: replace the jest presets with shared vitest configurations, `@websolutespa/test/vitest` (`defineNodeConfig`, `defineDomConfig`, `definePayloadConfig`); drop jest dependencies
20
+ - declare every imported package and script binary in the package that uses it (no more reliance on hoisting), drop unused dependencies
21
+ - bom-mixer-checkout: `useCart.add` no longer mutates the previous cart state
22
+
23
+ ## 3.0.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Updating: dependencies
28
+ - Updated dependencies
29
+ - @websolutespa/bom-mixer-hooks@3.0.1
30
+ - @websolutespa/bom-core@3.0.1
31
+
32
+ ## 3.0.0
33
+
34
+ ### Major Changes
35
+
36
+ - Release: Bom 3.0
37
+
38
+ ## 0.0.1
39
+
40
+ ### Patch Changes
41
+
42
+ - Added: first release
package/dist/index.d.ts CHANGED
@@ -28,16 +28,12 @@ type IEmailComponent<T> = FC<Readonly<IEmailSharedProps & {
28
28
  }>> & {
29
29
  Layout?: IEmailLayoutComponent;
30
30
  };
31
- //# sourceMappingURL=types.d.ts.map
32
31
  //#endregion
33
32
  //#region src/app.d.ts
34
33
  declare const App: IEmailAppComponent;
35
- //# sourceMappingURL=app.d.ts.map
36
34
  //#endregion
37
35
  //#region src/render.d.ts
38
- declare function renderEmail<T>(props: IEmailAppProps<T>): string;
39
- //# sourceMappingURL=render.d.ts.map
40
-
36
+ declare function renderEmail<T>(props: IEmailAppProps<T>): Promise<string>;
41
37
  //#endregion
42
38
  export { App, IEmailAppComponent, IEmailAppProps, IEmailComponent, IEmailLayoutComponent, IEmailLayoutProps, IEmailSharedProps, renderEmail };
43
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/app.tsx","../src/render.tsx"],"sourcesContent":[],"mappings":";;;;KAGY,iBAAA;;EAAA,MAAA,EAEF,OAFE;EASA,QAAA,CAAA,EAAA,MAAc;EAAA,SAAA,CAAA,EAAA,MAAA;EAAA,YAAM,CAAA,EAAA,MAAA;E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EAC3B,KAAA,EAAO,CAAA;AAAA;AAAA,KAGG,qBAAA,GAAwB,EAAA,CAAG,QAAA,CAAS,iBAAA;EAAsB,QAAA,EAAU,SAAA;AAAA;AAAA,KAEpE,eAAA,MAAqB,EAAA,CAAG,QAAA,CAAS,iBAAA;EAAsB,KAAA,EAAO,CAAA;AAAA;EACxE,MAAA,GAAS,qBAAA;AAAA;;;cCzBE,GAAA,EAAK,kBAAA;;;iBCEI,WAAA,GAAA,CAAe,KAAA,EAAO,cAAA,CAAe,CAAA,IAAK,OAAA"}
package/dist/index.js CHANGED
@@ -1,33 +1,29 @@
1
1
  import { LabelProvider, LayoutProvider } from "@websolutespa/bom-mixer-hooks";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { render } from "@react-email/render";
4
3
  import { isDevelopment } from "@websolutespa/bom-core";
5
-
6
4
  //#region src/app.tsx
7
- const App = ({ Component, Layout,...props }) => {
5
+ const App = ({ Component, Layout, ...props }) => {
8
6
  const LayoutComponent = Component.Layout || Layout;
9
- return /* @__PURE__ */ jsx(LayoutProvider, {
10
- layout: props.layout,
11
- children: /* @__PURE__ */ jsx(LabelProvider, { children: /* @__PURE__ */ jsx(LayoutComponent, {
12
- ...props,
13
- children: /* @__PURE__ */ jsx(Component, { ...props })
14
- }) })
15
- });
7
+ return <LayoutProvider layout={props.layout}>
8
+ <LabelProvider>
9
+ <LayoutComponent {...props}>
10
+ <Component {...props}></Component>
11
+ </LayoutComponent>
12
+ </LabelProvider>
13
+ </LayoutProvider>;
16
14
  };
17
-
18
15
  //#endregion
19
16
  //#region src/render.tsx
20
- function renderEmail(props) {
17
+ async function renderEmail(props) {
21
18
  const renderOptions = { pretty: isDevelopment };
22
19
  try {
23
- const html = render(/* @__PURE__ */ jsx(App, { ...props }), renderOptions);
24
- return html;
20
+ return await render(<App {...props} />, renderOptions);
25
21
  } catch (error) {
26
22
  console.log(error);
27
23
  return "An error occurred";
28
24
  }
29
25
  }
30
-
31
26
  //#endregion
32
27
  export { App, renderEmail };
28
+
33
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["App: IEmailAppComponent","props: IEmailAppProps<T>"],"sources":["../src/app.tsx","../src/render.tsx"],"sourcesContent":["import { LabelProvider, LayoutProvider } from '@websolutespa/bom-mixer-hooks';\r\nimport { IEmailAppComponent } from './types';\r\n\r\nexport const App: IEmailAppComponent = ({ Component, Layout, ...props }) => {\r\n const LayoutComponent = Component.Layout || Layout;\r\n return (\r\n <LayoutProvider layout={props.layout}>\r\n <LabelProvider>\r\n <LayoutComponent {...props}>\r\n <Component {...props}></Component>\r\n </LayoutComponent>\r\n </LabelProvider>\r\n </LayoutProvider>\r\n );\r\n};\r\n","\r\nimport { render } from '@react-email/render';\r\nimport { isDevelopment } from '@websolutespa/bom-core';\r\nimport { App } from './app';\r\nimport { IEmailAppProps } from './types';\r\n\r\nexport function renderEmail<T>(props: IEmailAppProps<T>) {\r\n // console.log('renderEmail.props', props);\r\n const renderOptions = { pretty: isDevelopment };\r\n // console.log('renderEmail.renderOptions', renderOptions);\r\n try {\r\n const html = render((<App {...props} />), renderOptions);\r\n // console.log('renderEmail', 'html', html);\r\n return html;\r\n } catch (error) {\r\n console.log(error);\r\n return 'An error occurred';\r\n }\r\n}\r\n"],"mappings":";;;;;;AAGA,MAAaA,MAA0B,CAAC,EAAE,WAAW,OAAQ,GAAG,OAAO,KAAK;CAC1E,MAAM,kBAAkB,UAAU,UAAU;AAC5C,4BACG;EAAe,QAAQ,MAAM;gCAC3B,+CACE;GAAgB,GAAI;iCAClB,aAAU,GAAI,QAAmB;IAClB,GACJ;GACD;AAEpB;;;;ACRD,SAAgB,YAAeC,OAA0B;CAEvD,MAAM,gBAAgB,EAAE,QAAQ,cAAe;AAE/C,KAAI;EACF,MAAM,OAAO,2BAAS,OAAI,GAAI,QAAS,EAAG,cAAc;AAExD,SAAO;CACR,SAAQ,OAAO;EACd,QAAQ,IAAI,MAAM;AAClB,SAAO;CACR;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/app.tsx","../src/render.tsx"],"sourcesContent":["import { LabelProvider, LayoutProvider } from '@websolutespa/bom-mixer-hooks';\r\nimport { IEmailAppComponent } from './types';\r\n\r\nexport const App: IEmailAppComponent = ({ Component, Layout, ...props }) => {\r\n const LayoutComponent = Component.Layout || Layout;\r\n return (\r\n <LayoutProvider layout={props.layout}>\r\n <LabelProvider>\r\n <LayoutComponent {...props}>\r\n <Component {...props}></Component>\r\n </LayoutComponent>\r\n </LabelProvider>\r\n </LayoutProvider>\r\n );\r\n};\r\n","import { render } from '@react-email/render';\nimport { isDevelopment } from '@websolutespa/bom-core';\nimport { App } from './app';\nimport { IEmailAppProps } from './types';\n\nexport async function renderEmail<T>(props: IEmailAppProps<T>): Promise<string> {\n // console.log('renderEmail.props', props);\n const renderOptions = { pretty: isDevelopment };\n // console.log('renderEmail.renderOptions', renderOptions);\n try {\n const html = await render((<App {...props} />), renderOptions);\n // console.log('renderEmail', 'html', html);\n return html;\n } catch (error) {\n console.log(error);\n return 'An error occurred';\n }\n}\n"],"mappings":";;;;AAGA,MAAa,OAA2B,EAAE,WAAW,QAAQ,GAAG,YAAY;CAC1E,MAAM,kBAAkB,UAAU,UAAU;AAC5C,QACE,CAAC,eAAe,QAAQ,MAAM,QAAQ;MACpC,CAAC,cAAc;QACb,CAAC,oBAAoB,OAAO;UAC1B,CAAC,cAAc,OAAO,EAAE,UAAU;QACpC,EAAE,gBAAgB;MACpB,EAAE,cAAc;IAClB,EAAE;;;;ACPN,eAAsB,YAAe,OAA2C;CAE9E,MAAM,gBAAgB,EAAE,QAAQ,eAAe;AAE/C,KAAI;AAGF,SAFa,MAAM,OAAQ,CAAC,QAAQ,WAAY,cAAc;UAGvD,OAAO;AACd,UAAQ,IAAI,MAAM;AAClB,SAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-emails",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Mixer Emails module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -13,7 +13,7 @@
13
13
  "url": "git://github.com/websolutespa/bom.git"
14
14
  },
15
15
  "scripts": {
16
- "lint": "eslint *.ts*",
16
+ "lint": "eslint .",
17
17
  "test": "vitest run",
18
18
  "test-watch": "vitest",
19
19
  "coverage:integration": "npm run test -- --coverage.enabled --coverage.provider=istanbul --coverage.all",
@@ -25,28 +25,31 @@
25
25
  },
26
26
  "dependencies": {},
27
27
  "peerDependencies": {
28
- "@react-email/components": "0.0.20",
29
- "@react-email/render": "0.0.16",
30
- "@websolutespa/bom-core": "*",
31
- "@websolutespa/bom-mixer-hooks": "*",
32
- "react-dom": "19.2.3",
33
- "react": "19.2.3"
28
+ "@react-email/components": "^1.0.12",
29
+ "@react-email/render": "^2.1.1",
30
+ "@websolutespa/bom-core": "^3.0.1",
31
+ "@websolutespa/bom-mixer-hooks": "^3.0.1",
32
+ "react": "^19.2.1",
33
+ "react-dom": "^19.2.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@react-email/components": "0.0.20",
37
- "@react-email/render": "0.0.16",
38
- "@types/react-dom": "19.2.3",
39
- "@types/react": "19.2.10",
40
- "@websolutespa/bom-cli": "*",
41
- "@websolutespa/test": "*",
42
- "@websolutespa/tsconfig": "*",
43
- "@websolutespa/eslint-config": "*",
44
- "eslint": "9.31.0",
36
+ "@react-email/components": "1.0.12",
37
+ "@react-email/render": "2.1.1",
38
+ "@types/react": "19.2.18",
39
+ "@types/react-dom": "19.2.7",
40
+ "@vitest/coverage-istanbul": "5.0.5",
41
+ "@websolutespa/bom-cli": "^3.1.0",
42
+ "@websolutespa/eslint-config": "^3.1.0",
43
+ "@websolutespa/test": "^3.1.0",
44
+ "@websolutespa/tsconfig": "^3.1.0",
45
+ "eslint": "10.13.0",
45
46
  "npm-run-all": "4.1.5",
46
- "react-dom": "19.2.3",
47
- "react-error-boundary": "4.1.2",
48
- "react": "19.2.3",
49
- "typescript": "5.8.3"
47
+ "react": "19.2.9",
48
+ "react-dom": "19.2.9",
49
+ "react-error-boundary": "6.1.6",
50
+ "tsdown": "0.21.0",
51
+ "typescript": "6.0.3",
52
+ "vitest": "5.0.5"
50
53
  },
51
54
  "publishConfig": {
52
55
  "access": "public"
@@ -0,0 +1,31 @@
1
+ import { Body, Html, Text } from '@react-email/components';
2
+ import type { ILayout } from '@websolutespa/bom-core';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { renderEmail } from '../render';
5
+ import type { IEmailComponent, IEmailLayoutComponent } from '../types';
6
+
7
+ const Layout: IEmailLayoutComponent = ({ children }) => (
8
+ <Html lang="en">
9
+ <Body>{children}</Body>
10
+ </Html>
11
+ );
12
+
13
+ const Component: IEmailComponent<{ name: string }> = ({ props }) => (
14
+ <Text>Hello {props.name}</Text>
15
+ );
16
+
17
+ describe('renderEmail', () => {
18
+ it('renders the component inside the layout as an html document', async () => {
19
+ const html = await renderEmail({
20
+ Component,
21
+ Layout,
22
+ layout: { labels: [] } as unknown as ILayout,
23
+ origin: 'https://example.com',
24
+ props: { name: 'Ada' },
25
+ });
26
+
27
+ expect(html.startsWith('<!DOCTYPE html')).toBe(true);
28
+ expect(html).toMatch(/<html[^>]* lang="en"/);
29
+ expect(html).toMatch(/Hello (<!-- -->)?Ada/);
30
+ });
31
+ });
package/src/render.tsx CHANGED
@@ -1,19 +1,18 @@
1
-
2
- import { render } from '@react-email/render';
3
- import { isDevelopment } from '@websolutespa/bom-core';
4
- import { App } from './app';
5
- import { IEmailAppProps } from './types';
6
-
7
- export function renderEmail<T>(props: IEmailAppProps<T>) {
8
- // console.log('renderEmail.props', props);
9
- const renderOptions = { pretty: isDevelopment };
10
- // console.log('renderEmail.renderOptions', renderOptions);
11
- try {
12
- const html = render((<App {...props} />), renderOptions);
13
- // console.log('renderEmail', 'html', html);
14
- return html;
15
- } catch (error) {
16
- console.log(error);
17
- return 'An error occurred';
18
- }
19
- }
1
+ import { render } from '@react-email/render';
2
+ import { isDevelopment } from '@websolutespa/bom-core';
3
+ import { App } from './app';
4
+ import { IEmailAppProps } from './types';
5
+
6
+ export async function renderEmail<T>(props: IEmailAppProps<T>): Promise<string> {
7
+ // console.log('renderEmail.props', props);
8
+ const renderOptions = { pretty: isDevelopment };
9
+ // console.log('renderEmail.renderOptions', renderOptions);
10
+ try {
11
+ const html = await render((<App {...props} />), renderOptions);
12
+ // console.log('renderEmail', 'html', html);
13
+ return html;
14
+ } catch (error) {
15
+ console.log(error);
16
+ return 'An error occurred';
17
+ }
18
+ }