@spinajs/templates-puppeteer 2.0.438
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 +9 -0
- package/lib/cjs/config/pdf.d.ts +15 -0
- package/lib/cjs/config/pdf.d.ts.map +1 -0
- package/lib/cjs/config/pdf.js +17 -0
- package/lib/cjs/config/pdf.js.map +1 -0
- package/lib/cjs/index.d.ts +60 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +273 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +1 -0
- package/lib/mjs/config/pdf.d.ts +15 -0
- package/lib/mjs/config/pdf.d.ts.map +1 -0
- package/lib/mjs/config/pdf.js +15 -0
- package/lib/mjs/config/pdf.js.map +1 -0
- package/lib/mjs/index.d.ts +60 -0
- package/lib/mjs/index.d.ts.map +1 -0
- package/lib/mjs/index.js +266 -0
- package/lib/mjs/index.js.map +1 -0
- package/lib/mjs/package.json +1 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -0
- package/lib/tsconfig.mjs.tsbuildinfo +1 -0
- package/package.json +70 -0
package/lib/mjs/index.js
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { default as puppeteer } from 'puppeteer';
|
|
11
|
+
import { NotSupported } from '@spinajs/exceptions';
|
|
12
|
+
import { TemplateRenderer, Templates } from '@spinajs/templates';
|
|
13
|
+
import { LazyInject } from '@spinajs/di';
|
|
14
|
+
import { basename, dirname, join } from 'path';
|
|
15
|
+
import { Log, Logger } from '@spinajs/log';
|
|
16
|
+
import Express from 'express';
|
|
17
|
+
import cors from 'cors';
|
|
18
|
+
import '@spinajs/templates-pug';
|
|
19
|
+
import _ from 'lodash';
|
|
20
|
+
export class PuppeteerRenderer extends TemplateRenderer {
|
|
21
|
+
async renderToFile(template, model, filePath, language) {
|
|
22
|
+
let server = null;
|
|
23
|
+
let browser = null;
|
|
24
|
+
try {
|
|
25
|
+
this.Log.timeStart(`puppeteer-template-rendering-${filePath}`);
|
|
26
|
+
this.Log.trace(`Rendering template ${template} to file ${filePath}`);
|
|
27
|
+
const templateBasePath = dirname(template);
|
|
28
|
+
// fire up local http server for serving images etc
|
|
29
|
+
// becouse chromium prevents from reading local files when not
|
|
30
|
+
// rendering file with file:// protocol for security reasons
|
|
31
|
+
server = await this.runLocalServer(templateBasePath);
|
|
32
|
+
const httpPort = server.address().port;
|
|
33
|
+
const compiledTemplate = await this.TemplatingService.render(join(templateBasePath, basename(template, this.Extension)) + '.pug', {
|
|
34
|
+
// add template temporary server port
|
|
35
|
+
// so we can use it to render images in template
|
|
36
|
+
__http_template_port__: httpPort,
|
|
37
|
+
// for convinience add full url to local http server
|
|
38
|
+
__http_template_address__: `http://localhost:${httpPort}`,
|
|
39
|
+
...model,
|
|
40
|
+
}, language);
|
|
41
|
+
const launchOptions = {
|
|
42
|
+
...(this.Options?.args || {}),
|
|
43
|
+
...(this.Options?.executablePath && {
|
|
44
|
+
executablePath: this.Options.executablePath,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
browser = await puppeteer.launch(launchOptions);
|
|
48
|
+
const page = await browser.newPage();
|
|
49
|
+
// Skip timeouts in debug mode
|
|
50
|
+
if (!this.Options?.debug?.close) {
|
|
51
|
+
page.setDefaultNavigationTimeout(this.Options?.navigationTimeout || 30000); // Default 30s
|
|
52
|
+
page.setDefaultTimeout(this.Options?.renderTimeout || 30000); // Default 30s
|
|
53
|
+
}
|
|
54
|
+
// Set up render timeout (skip in debug mode)
|
|
55
|
+
let renderTimeout;
|
|
56
|
+
if (!this.Options?.debug?.close) {
|
|
57
|
+
const timeoutMs = this.Options?.renderTimeout || 30000;
|
|
58
|
+
renderTimeout = setTimeout(async () => {
|
|
59
|
+
this.Log.warn(`Render timeout (${timeoutMs}ms) - forcing cleanup`);
|
|
60
|
+
try {
|
|
61
|
+
if (page)
|
|
62
|
+
await page.close().catch(() => { });
|
|
63
|
+
if (browser)
|
|
64
|
+
await this.forceCloseBrowser(browser);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
this.Log.error('Error during timeout cleanup:', err);
|
|
68
|
+
}
|
|
69
|
+
}, timeoutMs);
|
|
70
|
+
}
|
|
71
|
+
// Add event listeners with explicit cleanup tracking
|
|
72
|
+
const eventCleanup = this.addPageEventListeners(page);
|
|
73
|
+
try {
|
|
74
|
+
await page.setBypassCSP(true);
|
|
75
|
+
await page.setContent(compiledTemplate);
|
|
76
|
+
// Call abstract method to perform specific rendering (PDF or image)
|
|
77
|
+
await this.performRender(page, filePath);
|
|
78
|
+
// Clear timeout on successful completion
|
|
79
|
+
if (renderTimeout) {
|
|
80
|
+
clearTimeout(renderTimeout);
|
|
81
|
+
renderTimeout = undefined;
|
|
82
|
+
}
|
|
83
|
+
// Clean up event listeners
|
|
84
|
+
eventCleanup();
|
|
85
|
+
}
|
|
86
|
+
catch (renderError) {
|
|
87
|
+
// Clear timeout on error
|
|
88
|
+
if (renderTimeout) {
|
|
89
|
+
clearTimeout(renderTimeout);
|
|
90
|
+
renderTimeout = undefined;
|
|
91
|
+
}
|
|
92
|
+
this.Log.error(renderError, `Error during rendering for template ${template}`);
|
|
93
|
+
throw renderError;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
this.Log.error(err, `Error rendering template ${template} to file ${filePath}`);
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
const duration = this.Log.timeEnd(`puppeteer-template-rendering-${filePath}`);
|
|
102
|
+
this.Log.trace(`Ended rendering template ${template} to file ${filePath}, took: ${duration}ms`);
|
|
103
|
+
if (this.Options && duration > this.Options.renderDurationWarning) {
|
|
104
|
+
this.Log.warn(`Rendering template ${template} to file ${filePath} took too long.`);
|
|
105
|
+
}
|
|
106
|
+
// Skip browser cleanup if debug.close is false (keep browser open for inspection)
|
|
107
|
+
if (browser && (!this.Options || this.Options.debug?.close !== false)) {
|
|
108
|
+
await this.safeBrowserCleanup(browser);
|
|
109
|
+
}
|
|
110
|
+
else if (browser) {
|
|
111
|
+
this.Log.info('Browser kept open for debugging (debug.close=false)');
|
|
112
|
+
}
|
|
113
|
+
if (server) {
|
|
114
|
+
await this.safeServerCleanup(server);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async render(_templateName, _model, _language) {
|
|
119
|
+
throw new NotSupported('cannot render puppeteer template to string');
|
|
120
|
+
}
|
|
121
|
+
// no compilation at start
|
|
122
|
+
async compile(_path) { }
|
|
123
|
+
async runLocalServer(basePath) {
|
|
124
|
+
const self = this;
|
|
125
|
+
const app = Express();
|
|
126
|
+
app.use(cors());
|
|
127
|
+
app.use(Express.static(basePath));
|
|
128
|
+
return new Promise((resolve, reject) => {
|
|
129
|
+
const server = app
|
|
130
|
+
// if no port is provided express will choose random port to start (available)
|
|
131
|
+
// if not, we will get random from range in config
|
|
132
|
+
.listen(!this.Options?.static?.portRange || this.Options.static.portRange.length === 0
|
|
133
|
+
? 0
|
|
134
|
+
: _.random(this.Options.static.portRange[0], this.Options.static.portRange[1]))
|
|
135
|
+
.on('listening', function () {
|
|
136
|
+
self.Log.trace(`Puppeteer image server started on port ${this.address().port}`);
|
|
137
|
+
self.Log.trace(`Puppeteer static file dir at ${basePath}`);
|
|
138
|
+
resolve(this);
|
|
139
|
+
})
|
|
140
|
+
.on('error', (err) => {
|
|
141
|
+
self.Log.error(err, `Puppeteer image server cannot start`);
|
|
142
|
+
// Clean up the failed server
|
|
143
|
+
if (server) {
|
|
144
|
+
server.close(() => {
|
|
145
|
+
reject(err);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
reject(err);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
// Set a timeout for server startup
|
|
153
|
+
setTimeout(() => {
|
|
154
|
+
if (!server.listening) {
|
|
155
|
+
server.close();
|
|
156
|
+
reject(new Error('Server startup timeout'));
|
|
157
|
+
}
|
|
158
|
+
}, 10000);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Enhanced browser cleanup with error handling
|
|
163
|
+
*/
|
|
164
|
+
async safeBrowserCleanup(browser) {
|
|
165
|
+
try {
|
|
166
|
+
// First try to close all pages
|
|
167
|
+
const pages = await browser.pages();
|
|
168
|
+
await Promise.allSettled(pages.map(page => page.close()));
|
|
169
|
+
// Then close the browser normally
|
|
170
|
+
await browser.close();
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
this.Log.warn(`Error during normal browser cleanup: ${err.message}`);
|
|
174
|
+
// Force kill if normal close fails
|
|
175
|
+
try {
|
|
176
|
+
await this.forceCloseBrowser(browser);
|
|
177
|
+
}
|
|
178
|
+
catch (killErr) {
|
|
179
|
+
this.Log.error(`Failed to force kill browser: ${killErr.message}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Force close browser with process termination
|
|
185
|
+
*/
|
|
186
|
+
async forceCloseBrowser(browser) {
|
|
187
|
+
try {
|
|
188
|
+
const process = browser.process();
|
|
189
|
+
if (process) {
|
|
190
|
+
process.kill('SIGKILL');
|
|
191
|
+
this.Log.warn('Browser process force killed');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch (err) {
|
|
195
|
+
this.Log.error(`Error force killing browser process: ${err.message}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Enhanced server cleanup with timeout
|
|
200
|
+
*/
|
|
201
|
+
async safeServerCleanup(server) {
|
|
202
|
+
try {
|
|
203
|
+
await new Promise((resolve, reject) => {
|
|
204
|
+
const timeout = setTimeout(() => {
|
|
205
|
+
reject(new Error('Server close timeout'));
|
|
206
|
+
}, 5000);
|
|
207
|
+
server.close((err) => {
|
|
208
|
+
clearTimeout(timeout);
|
|
209
|
+
if (err)
|
|
210
|
+
reject(err);
|
|
211
|
+
else
|
|
212
|
+
resolve();
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch (err) {
|
|
217
|
+
this.Log.warn(`Error closing server: ${err.message}`);
|
|
218
|
+
// Force close connections if available
|
|
219
|
+
try {
|
|
220
|
+
if ('closeAllConnections' in server) {
|
|
221
|
+
server.closeAllConnections();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (forceErr) {
|
|
225
|
+
this.Log.error(`Error force closing server connections: ${forceErr.message}`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Add page event listeners with cleanup function
|
|
231
|
+
*/
|
|
232
|
+
addPageEventListeners(page) {
|
|
233
|
+
const listeners = {
|
|
234
|
+
console: (message) => this.Log.trace(`${message.type().substr(0, 3).toUpperCase()} ${message.text()}`),
|
|
235
|
+
pageerror: ({ message }) => this.Log.error(message),
|
|
236
|
+
response: (response) => this.Log.trace(`${response.status()} ${response.url()}`),
|
|
237
|
+
requestfailed: (request) => this.Log.error(`${request.failure().errorText} ${request.url()}`)
|
|
238
|
+
};
|
|
239
|
+
// Add listeners
|
|
240
|
+
page.on('console', listeners.console);
|
|
241
|
+
page.on('pageerror', listeners.pageerror);
|
|
242
|
+
page.on('response', listeners.response);
|
|
243
|
+
page.on('requestfailed', listeners.requestfailed);
|
|
244
|
+
// Return cleanup function
|
|
245
|
+
return () => {
|
|
246
|
+
try {
|
|
247
|
+
page.removeListener('console', listeners.console);
|
|
248
|
+
page.removeListener('pageerror', listeners.pageerror);
|
|
249
|
+
page.removeListener('response', listeners.response);
|
|
250
|
+
page.removeListener('requestfailed', listeners.requestfailed);
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
this.Log.warn(`Error removing page listeners: ${err.message}`);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
__decorate([
|
|
259
|
+
Logger('puppeteer-templates'),
|
|
260
|
+
__metadata("design:type", Log)
|
|
261
|
+
], PuppeteerRenderer.prototype, "Log", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
LazyInject(),
|
|
264
|
+
__metadata("design:type", Templates)
|
|
265
|
+
], PuppeteerRenderer.prototype, "TemplatingService", void 0);
|
|
266
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAiB,OAAO,IAAI,SAAS,EAAiB,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,IAAI,M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