@muil/templates-renderer
Advanced tools
Comparing version 2.0.0 to 2.1.1
{ | ||
"name": "@muil/templates-renderer", | ||
"version": "2.0.0", | ||
"version": "2.1.1", | ||
"license": "MIT", | ||
@@ -22,7 +22,4 @@ "main": "src/index.js", | ||
"puppeteer-core": "^22.6.1", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"reflect-metadata": "^0.1.13", | ||
"rxjs": "^6.5.4", | ||
"styled-components": "^6.1.11", | ||
"uuid": "^8.3.1" | ||
@@ -35,3 +32,8 @@ }, | ||
}, | ||
"gitHead": "eaccfeb02fc6c121d295ee9533b0315be0f1aa45" | ||
"peerDependencies": { | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"styled-components": "^6.1.11" | ||
}, | ||
"gitHead": "a1523c47bd2f7435d6f88bf25479d4cb001c76ef" | ||
} |
@@ -1,4 +0,3 @@ | ||
/// <reference types="node" /> | ||
import * as puppeteer from 'puppeteer-core'; | ||
export declare const generatePdf: (html: string, format?: puppeteer.PaperFormat, orientation?: 'portrait' | 'landscape') => Promise<Buffer>; | ||
export declare const generatePng: (html: string) => Promise<Buffer>; |
@@ -1,4 +0,3 @@ | ||
/// <reference types="node" /> | ||
import { RenderOptions } from './types'; | ||
declare const renderTemplate: ({ type, templatePath, templateCssPath, props, styleCollectors, shadowSupport, inlineCss, minifyHtml, pdfFormat, pdfOrientation, }: RenderOptions) => Promise<string | Buffer | void>; | ||
export default renderTemplate; |
@@ -31,2 +31,3 @@ "use strict"; | ||
const fs = __importStar(require("fs")); | ||
const path = __importStar(require("path")); | ||
const he_1 = __importDefault(require("he")); | ||
@@ -45,3 +46,3 @@ const html_minifier_1 = require("html-minifier"); | ||
await fs.promises.copyFile(templatePath, tempFileName); | ||
const ReactComponent = await (_a = tempFileName, Promise.resolve().then(() => __importStar(require(_a)))); | ||
const ReactComponent = await (_a = path.join(process.cwd(), tempFileName), Promise.resolve().then(() => __importStar(require(_a)))); | ||
const ReactElement = (0, react_1.createElement)(ReactComponent.default, props); | ||
@@ -48,0 +49,0 @@ await fs.promises.unlink(tempFileName); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87929
333
- Removedreact@^18.3.1
- Removedreact-dom@^18.3.1
- Removedstyled-components@^6.1.11