react-email 5.0.0-canary.0 → 5.0.0-canary.2

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,5 +1,13 @@
1
1
  # react-email
2
2
 
3
+ ## 5.0.0-canary.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1b3176e: fallback to not text coloring for Node.js < 20
8
+
9
+ ## 5.0.0-canary.1
10
+
3
11
  ## 5.0.0-canary.0
4
12
 
5
13
  ## 4.3.2
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import { parse } from "@babel/parser";
17
17
  import traverseModule from "@babel/traverse";
18
18
  import { createMatchPath, loadConfig } from "tsconfig-paths";
19
19
  import http from "node:http";
20
- import { styleText } from "node:util";
20
+ import * as nodeUtil from "node:util";
21
21
  import { lookup } from "mime-types";
22
22
  import os from "node:os";
23
23
  import { build } from "esbuild";
@@ -86,7 +86,7 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
86
86
  //#region package.json
87
87
  var package_default = {
88
88
  name: "react-email",
89
- version: "5.0.0-canary.0",
89
+ version: "5.0.0-canary.2",
90
90
  description: "A live preview of your emails right in your browser.",
91
91
  bin: { "email": "./dist/index.js" },
92
92
  type: "module",
@@ -601,6 +601,10 @@ const setupHotreloading = async (devServer$1, emailDirRelativePath) => {
601
601
  return watcher;
602
602
  };
603
603
 
604
+ //#endregion
605
+ //#region src/utils/style-text.ts
606
+ const styleText = nodeUtil.styleText ? nodeUtil.styleText : (_, text) => text;
607
+
604
608
  //#endregion
605
609
  //#region src/utils/preview/get-env-variables-for-preview-app.ts
606
610
  const getEnvVariablesForPreviewApp = (relativePathToEmailsDirectory, previewServerLocation, cwd) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-email",
3
- "version": "5.0.0-canary.0",
3
+ "version": "5.0.0-canary.2",
4
4
  "description": "A live preview of your emails right in your browser.",
5
5
  "bin": {
6
6
  "email": "./dist/index.js"
@@ -1,13 +1,13 @@
1
1
  import http from 'node:http';
2
2
  import path from 'node:path';
3
3
  import url from 'node:url';
4
- import { styleText } from 'node:util';
5
4
  import { createJiti } from 'jiti';
6
5
  import logSymbols from 'log-symbols';
7
6
  import ora from 'ora';
8
7
  import { registerSpinnerAutostopping } from '../../utils/register-spinner-autostopping.js';
9
8
  import { getPreviewServerLocation } from '../get-preview-server-location.js';
10
9
  import { packageJson } from '../packageJson.js';
10
+ import { styleText } from '../style-text.js';
11
11
  import { getEnvVariablesForPreviewApp } from './get-env-variables-for-preview-app.js';
12
12
  import { serveStaticFile } from './serve-static-file.js';
13
13
 
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Centralized fallback for Node versions (<20.12.0) without util.styleText.
3
+ * Returns the original text when styleText is unavailable.
4
+ */
5
+ import * as nodeUtil from 'node:util';
6
+
7
+ type StyleTextFunction = (style: string, text: string) => string;
8
+
9
+ export const styleText: StyleTextFunction = (nodeUtil as any).styleText
10
+ ? (nodeUtil as any).styleText
11
+ : (_: string, text: string) => text;