react-email 5.0.0-canary.1 → 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 +6 -0
- package/dist/index.js +6 -2
- package/package.json +1 -1
- package/src/utils/preview/start-dev-server.ts +1 -1
- package/src/utils/style-text.ts +11 -0
package/CHANGELOG.md
CHANGED
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
|
|
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.
|
|
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,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;
|