@spinajs/templates 2.0.481 → 2.0.484
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/lib/cjs/CompiledTemplateRenderer.d.ts +41 -0
- package/lib/cjs/CompiledTemplateRenderer.d.ts.map +1 -0
- package/lib/cjs/CompiledTemplateRenderer.js +83 -0
- package/lib/cjs/CompiledTemplateRenderer.js.map +1 -0
- package/lib/cjs/cli/renderHelpers.d.ts +26 -0
- package/lib/cjs/cli/renderHelpers.d.ts.map +1 -0
- package/lib/cjs/cli/renderHelpers.js +101 -0
- package/lib/cjs/cli/renderHelpers.js.map +1 -0
- package/lib/cjs/config/templates.d.ts +3 -1
- package/lib/cjs/config/templates.d.ts.map +1 -1
- package/lib/cjs/config/templates.js +15 -3
- package/lib/cjs/config/templates.js.map +1 -1
- package/lib/cjs/index.d.ts +21 -4
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +35 -20
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces.d.ts +52 -9
- package/lib/cjs/interfaces.d.ts.map +1 -1
- package/lib/cjs/interfaces.js +101 -5
- package/lib/cjs/interfaces.js.map +1 -1
- package/lib/cjs/io.d.ts +3 -0
- package/lib/cjs/io.d.ts.map +1 -0
- package/lib/cjs/io.js +46 -0
- package/lib/cjs/io.js.map +1 -0
- package/lib/cjs/progress.d.ts +57 -0
- package/lib/cjs/progress.d.ts.map +1 -0
- package/lib/cjs/progress.js +23 -0
- package/lib/cjs/progress.js.map +1 -0
- package/lib/mjs/CompiledTemplateRenderer.d.ts +41 -0
- package/lib/mjs/CompiledTemplateRenderer.d.ts.map +1 -0
- package/lib/mjs/CompiledTemplateRenderer.js +46 -0
- package/lib/mjs/CompiledTemplateRenderer.js.map +1 -0
- package/lib/mjs/cli/renderHelpers.d.ts +26 -0
- package/lib/mjs/cli/renderHelpers.d.ts.map +1 -0
- package/lib/mjs/cli/renderHelpers.js +62 -0
- package/lib/mjs/cli/renderHelpers.js.map +1 -0
- package/lib/mjs/config/templates.d.ts +3 -1
- package/lib/mjs/config/templates.d.ts.map +1 -1
- package/lib/mjs/config/templates.js +15 -3
- package/lib/mjs/config/templates.js.map +1 -1
- package/lib/mjs/index.d.ts +21 -4
- package/lib/mjs/index.d.ts.map +1 -1
- package/lib/mjs/index.js +36 -21
- package/lib/mjs/index.js.map +1 -1
- package/lib/mjs/interfaces.d.ts +52 -9
- package/lib/mjs/interfaces.d.ts.map +1 -1
- package/lib/mjs/interfaces.js +101 -5
- package/lib/mjs/interfaces.js.map +1 -1
- package/lib/mjs/io.d.ts +3 -0
- package/lib/mjs/io.d.ts.map +1 -0
- package/lib/mjs/io.js +10 -0
- package/lib/mjs/io.js.map +1 -0
- package/lib/mjs/progress.d.ts +57 -0
- package/lib/mjs/progress.d.ts.map +1 -0
- package/lib/mjs/progress.js +20 -0
- package/lib/mjs/progress.js.map +1 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +16 -16
package/lib/mjs/index.js
CHANGED
|
@@ -9,11 +9,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { InvalidOperation } from '@spinajs/exceptions';
|
|
11
11
|
import { AsyncService, Inject, Autoinject } from '@spinajs/di';
|
|
12
|
-
import { Log, Logger } from '@spinajs/log';
|
|
12
|
+
import { Log, Logger, Perf } from '@spinajs/log';
|
|
13
13
|
import { TemplateRenderer } from './interfaces.js';
|
|
14
14
|
import { extname } from 'path';
|
|
15
15
|
import { Intl } from '@spinajs/intl';
|
|
16
16
|
export * from './interfaces.js';
|
|
17
|
+
export * from './progress.js';
|
|
18
|
+
export * from './io.js';
|
|
19
|
+
export * from './CompiledTemplateRenderer.js';
|
|
20
|
+
export * from './cli/renderHelpers.js';
|
|
17
21
|
/**
|
|
18
22
|
* Inject INTL module for language support. We does nothing but to initialize module for use in templates.
|
|
19
23
|
*/
|
|
@@ -21,12 +25,9 @@ let Templates = class Templates extends AsyncService {
|
|
|
21
25
|
getRendererFor(extname) {
|
|
22
26
|
return this.Renderers.find((x) => x.Extension === extname);
|
|
23
27
|
}
|
|
24
|
-
async compileToFile(template, renderer, model, filePath, language) {
|
|
25
|
-
const engine = this.
|
|
26
|
-
|
|
27
|
-
throw new InvalidOperation(`No renderer for ${renderer}`);
|
|
28
|
-
}
|
|
29
|
-
return await engine.renderToFile(template, model, filePath, language);
|
|
28
|
+
async compileToFile(template, renderer, model, filePath, language, options) {
|
|
29
|
+
const engine = this.engineByType(renderer);
|
|
30
|
+
return await Perf.measure('template.compile', () => engine.renderToFile(template, model, filePath, language, options), { labels: { engine: engine.Type }, fields: { template } });
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
*
|
|
@@ -36,14 +37,12 @@ let Templates = class Templates extends AsyncService {
|
|
|
36
37
|
* @param renderer
|
|
37
38
|
* @param model
|
|
38
39
|
* @param language
|
|
40
|
+
* @param options - optional render options (e.g. progress reporting)
|
|
39
41
|
* @returns
|
|
40
42
|
*/
|
|
41
|
-
async compile(template, renderer, model, language) {
|
|
42
|
-
const engine = this.
|
|
43
|
-
|
|
44
|
-
throw new InvalidOperation(`No renderer for ${renderer}`);
|
|
45
|
-
}
|
|
46
|
-
return await engine.render(template, model, language);
|
|
43
|
+
async compile(template, renderer, model, language, options) {
|
|
44
|
+
const engine = this.engineByType(renderer);
|
|
45
|
+
return await Perf.measure('template.compile', () => engine.render(template, model, language, options), { labels: { engine: engine.Type }, fields: { template } });
|
|
47
46
|
}
|
|
48
47
|
/**
|
|
49
48
|
*
|
|
@@ -53,23 +52,39 @@ let Templates = class Templates extends AsyncService {
|
|
|
53
52
|
* @param template
|
|
54
53
|
* @param model
|
|
55
54
|
* @param language
|
|
55
|
+
* @param options - optional render options (e.g. progress reporting)
|
|
56
56
|
* @returns
|
|
57
57
|
*/
|
|
58
|
-
async render(template, model, language) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
async render(template, model, language, options) {
|
|
59
|
+
const renderer = this.engineByExtension(template);
|
|
60
|
+
return await Perf.measure('template.render', () => renderer.render(template, model, language, options), { labels: { engine: renderer.Type }, fields: { template } });
|
|
61
|
+
}
|
|
62
|
+
async renderToFile(template, model, filePath, language, options) {
|
|
63
|
+
const renderer = this.engineByExtension(template);
|
|
64
|
+
return await Perf.measure('template.render', () => renderer.renderToFile(template, model, filePath, language, options), { labels: { engine: renderer.Type }, fields: { template } });
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Finds the renderer registered under the given renderer type (e.g. `handlebars`,
|
|
68
|
+
* `pdf`), throwing if none is registered.
|
|
69
|
+
*/
|
|
70
|
+
engineByType(renderer) {
|
|
71
|
+
const engine = this.Renderers.find((x) => x.Type === renderer);
|
|
72
|
+
if (!engine) {
|
|
73
|
+
throw new InvalidOperation(`No renderer for ${renderer}`);
|
|
63
74
|
}
|
|
64
|
-
return
|
|
75
|
+
return engine;
|
|
65
76
|
}
|
|
66
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Finds the renderer matching the template file's extension, throwing if none
|
|
79
|
+
* is registered for that extension.
|
|
80
|
+
*/
|
|
81
|
+
engineByExtension(template) {
|
|
67
82
|
const extension = extname(template);
|
|
68
83
|
const renderer = this.Renderers.find((x) => x.Extension === extension);
|
|
69
84
|
if (!renderer) {
|
|
70
85
|
throw new InvalidOperation(`No renderer for file ${template} with extension ${extension}`);
|
|
71
86
|
}
|
|
72
|
-
return
|
|
87
|
+
return renderer;
|
|
73
88
|
}
|
|
74
89
|
};
|
|
75
90
|
__decorate([
|
package/lib/mjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAA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
import { IMappableService } from '@spinajs/di';
|
|
2
2
|
import { AsyncService } from '@spinajs/di';
|
|
3
3
|
import { Log } from '@spinajs/log';
|
|
4
|
+
import { IStat } from '@spinajs/fs';
|
|
5
|
+
import { IRenderOptions } from './progress.js';
|
|
6
|
+
/**
|
|
7
|
+
* How aggressively compiled templates are reused.
|
|
8
|
+
*
|
|
9
|
+
* cache - compile once, reuse forever. Default.
|
|
10
|
+
* revalidate - stat() the source and recompile only when its change token differs.
|
|
11
|
+
* always - recompile on every render.
|
|
12
|
+
*/
|
|
13
|
+
export type TemplateCacheMode = 'cache' | 'revalidate' | 'always';
|
|
14
|
+
export interface ITemplateCacheEntry {
|
|
15
|
+
compiled: unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Change token captured when this entry was compiled. Null when the mode does
|
|
18
|
+
* not track one, or when the source could not be stat-ed.
|
|
19
|
+
*/
|
|
20
|
+
token: string | null;
|
|
21
|
+
}
|
|
4
22
|
export declare abstract class TemplateRenderer extends AsyncService implements IMappableService {
|
|
5
23
|
protected Log: Log;
|
|
6
|
-
protected
|
|
7
|
-
protected
|
|
24
|
+
protected ConfiguredCacheMode: TemplateCacheMode;
|
|
25
|
+
protected DevMode: boolean;
|
|
26
|
+
protected Cache: Map<string, ITemplateCacheEntry>;
|
|
8
27
|
abstract get Type(): string;
|
|
9
28
|
abstract get Extension(): string;
|
|
10
29
|
get ServiceName(): string;
|
|
11
|
-
abstract render(templatePath: string, model: unknown, language?: string): Promise<string>;
|
|
12
|
-
abstract renderToFile(templatePath: string, model: unknown, filePath: string, language?: string): Promise<void>;
|
|
30
|
+
abstract render(templatePath: string, model: unknown, language?: string, options?: IRenderOptions): Promise<string>;
|
|
31
|
+
abstract renderToFile(templatePath: string, model: unknown, filePath: string, language?: string, options?: IRenderOptions): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Explicit config wins; otherwise dev mode implies always-recompile.
|
|
34
|
+
*/
|
|
35
|
+
protected get CacheMode(): TemplateCacheMode;
|
|
36
|
+
protected isUri(template: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Bare paths are normalized as before. URIs must be left alone - path.normalize
|
|
39
|
+
* would turn fs://name/x into fs:\name\x on windows and break URI parsing.
|
|
40
|
+
*/
|
|
41
|
+
protected normalizeTemplate(template: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Template source as text. Bare paths read from local disk exactly as before -
|
|
44
|
+
* routing them through the default provider would re-resolve relative paths
|
|
45
|
+
* against its basePath and break existing callers.
|
|
46
|
+
*/
|
|
47
|
+
protected resolveContent(template: string): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* A real local path. For renderers that cannot compile from a string (pug),
|
|
50
|
+
* remote sources are materialised to temp storage.
|
|
51
|
+
*/
|
|
52
|
+
protected resolveLocalPath(template: string): Promise<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Opaque token that changes when the source changes. Null means "cannot tell" -
|
|
55
|
+
* callers must then trust whatever they already have cached.
|
|
56
|
+
*/
|
|
57
|
+
protected changeToken(template: string): Promise<string | null>;
|
|
58
|
+
protected tokenFromStat(s: IStat): string;
|
|
13
59
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param templateName - template name
|
|
17
|
-
* @param path - template full path
|
|
60
|
+
* Compiled-template cache honouring CacheMode. `compile` runs only on a miss.
|
|
18
61
|
*/
|
|
19
|
-
protected
|
|
62
|
+
protected withCache<T>(template: string, compile: () => Promise<T>): Promise<T>;
|
|
20
63
|
}
|
|
21
64
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAA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AI1C;;;OAGG;IACH,SAAS,CAAC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIrD;;;;OAIG;cACa,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASjE;;;OAGG;cACa,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQnE;;;OAGG;cACa,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAcrE,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAQzC;;OAEG;cACa,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CA2BtF"}
|
package/lib/mjs/interfaces.js
CHANGED
|
@@ -7,25 +7,121 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { Config } from '@spinajs/configuration';
|
|
11
10
|
import { AsyncService } from '@spinajs/di';
|
|
11
|
+
import { Config } from '@spinajs/configuration';
|
|
12
12
|
import { Logger, Log } from '@spinajs/log';
|
|
13
|
+
import { fs, URI } from '@spinajs/fs';
|
|
14
|
+
import { readFile, stat as localStat } from 'fs/promises';
|
|
15
|
+
import { normalize } from 'path';
|
|
13
16
|
export class TemplateRenderer extends AsyncService {
|
|
14
17
|
constructor() {
|
|
15
18
|
super(...arguments);
|
|
16
|
-
this.
|
|
19
|
+
this.Cache = new Map();
|
|
17
20
|
}
|
|
18
21
|
get ServiceName() {
|
|
19
22
|
// we map this service by extension
|
|
20
23
|
return this.Extension;
|
|
21
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Explicit config wins; otherwise dev mode implies always-recompile.
|
|
27
|
+
*/
|
|
28
|
+
get CacheMode() {
|
|
29
|
+
if (this.ConfiguredCacheMode) {
|
|
30
|
+
return this.ConfiguredCacheMode;
|
|
31
|
+
}
|
|
32
|
+
return this.DevMode ? 'always' : 'cache';
|
|
33
|
+
}
|
|
34
|
+
isUri(template) {
|
|
35
|
+
return /^fs:\/\//.test(template);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Bare paths are normalized as before. URIs must be left alone - path.normalize
|
|
39
|
+
* would turn fs://name/x into fs:\name\x on windows and break URI parsing.
|
|
40
|
+
*/
|
|
41
|
+
normalizeTemplate(template) {
|
|
42
|
+
return this.isUri(template) ? template : normalize(template);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Template source as text. Bare paths read from local disk exactly as before -
|
|
46
|
+
* routing them through the default provider would re-resolve relative paths
|
|
47
|
+
* against its basePath and break existing callers.
|
|
48
|
+
*/
|
|
49
|
+
async resolveContent(template) {
|
|
50
|
+
if (!this.isUri(template)) {
|
|
51
|
+
return await readFile(template, 'utf-8');
|
|
52
|
+
}
|
|
53
|
+
const content = await fs.read(new URI(template), 'utf-8');
|
|
54
|
+
return Buffer.isBuffer(content) ? content.toString('utf-8') : content;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A real local path. For renderers that cannot compile from a string (pug),
|
|
58
|
+
* remote sources are materialised to temp storage.
|
|
59
|
+
*/
|
|
60
|
+
async resolveLocalPath(template) {
|
|
61
|
+
if (!this.isUri(template)) {
|
|
62
|
+
return template;
|
|
63
|
+
}
|
|
64
|
+
return await fs.download(new URI(template));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Opaque token that changes when the source changes. Null means "cannot tell" -
|
|
68
|
+
* callers must then trust whatever they already have cached.
|
|
69
|
+
*/
|
|
70
|
+
async changeToken(template) {
|
|
71
|
+
try {
|
|
72
|
+
if (this.isUri(template)) {
|
|
73
|
+
return this.tokenFromStat(await fs.stat(new URI(template)));
|
|
74
|
+
}
|
|
75
|
+
const s = await localStat(template);
|
|
76
|
+
return `${s.mtimeMs}|${s.size}`;
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
this.Log.warn(`Cannot stat template ${template}, serving cached version. ${err}`);
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
tokenFromStat(s) {
|
|
84
|
+
if (s.Version) {
|
|
85
|
+
return s.Version;
|
|
86
|
+
}
|
|
87
|
+
return `${s.ModifiedTime?.toMillis() ?? 0}|${s.Size ?? 0}`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Compiled-template cache honouring CacheMode. `compile` runs only on a miss.
|
|
91
|
+
*/
|
|
92
|
+
async withCache(template, compile) {
|
|
93
|
+
const mode = this.CacheMode;
|
|
94
|
+
if (mode === 'always') {
|
|
95
|
+
return await compile();
|
|
96
|
+
}
|
|
97
|
+
const key = this.normalizeTemplate(template);
|
|
98
|
+
const entry = this.Cache.get(key);
|
|
99
|
+
let token = null;
|
|
100
|
+
if (mode === 'revalidate') {
|
|
101
|
+
token = await this.changeToken(template);
|
|
102
|
+
// null token => stat failed; prefer a stale entry over failing the render
|
|
103
|
+
if (entry && (token === null || token === entry.token)) {
|
|
104
|
+
return entry.compiled;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else if (entry) {
|
|
108
|
+
return entry.compiled;
|
|
109
|
+
}
|
|
110
|
+
const compiled = await compile();
|
|
111
|
+
this.Cache.set(key, { compiled, token });
|
|
112
|
+
return compiled;
|
|
113
|
+
}
|
|
22
114
|
}
|
|
23
115
|
__decorate([
|
|
24
116
|
Logger('renderer'),
|
|
25
117
|
__metadata("design:type", Log)
|
|
26
118
|
], TemplateRenderer.prototype, "Log", void 0);
|
|
27
119
|
__decorate([
|
|
28
|
-
Config('
|
|
29
|
-
__metadata("design:type",
|
|
30
|
-
], TemplateRenderer.prototype, "
|
|
120
|
+
Config('templates.cache.mode'),
|
|
121
|
+
__metadata("design:type", String)
|
|
122
|
+
], TemplateRenderer.prototype, "ConfiguredCacheMode", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
Config('configuration.isDevelopment', { defaultValue: false }),
|
|
125
|
+
__metadata("design:type", Boolean)
|
|
126
|
+
], TemplateRenderer.prototype, "DevMode", void 0);
|
|
31
127
|
//# sourceMappingURL=interfaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAS,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAsBjC,MAAM,OAAgB,gBAAiB,SAAQ,YAAY;IAA3D;;QAUY,UAAK,GAAqC,IAAI,GAAG,EAA+B,CAAC;IAuH7F,CAAC;IAjHC,IAAW,WAAW;QACpB,mCAAmC;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAKD;;OAEG;IACH,IAAc,SAAS;QACrB,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,mBAAmB,CAAC;QAClC,CAAC;QAED,OAAO,IAAI,CAAC,OAA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AC,EAAE,CAAC;gBACvD,OAAO,KAAK,CAAC,QAAa,CAAC;YAC7B,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC,QAAa,CAAC;QAC7B,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA/HW;IADT,MAAM,CAAC,UAAU,CAAC;8BACJ,GAAG;6CAAC;AAGT;IADT,MAAM,CAAC,sBAAsB,CAAC;;6DACkB;AAGvC;IADT,MAAM,CAAC,6BAA6B,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;;iDACpC"}
|
package/lib/mjs/io.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/io.ts"],"names":[],"mappings":"AAGA,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAKtD"}
|
package/lib/mjs/io.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
/** Ensure the parent directory of `filePath` exists, creating it recursively if needed. */
|
|
4
|
+
export function ensureParentDir(filePath) {
|
|
5
|
+
const dir = path.dirname(filePath);
|
|
6
|
+
if (!fs.existsSync(dir)) {
|
|
7
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/io.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestones a (puppeteer) render passes through. Text engines complete
|
|
3
|
+
* synchronously and do not report phases.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum RenderPhase {
|
|
6
|
+
/** Local static server + pooled browser + page are being set up. */
|
|
7
|
+
Starting = "starting",
|
|
8
|
+
/** HTML is being built (template compiled / raw HTML injected) - before load. */
|
|
9
|
+
Preparing = "preparing",
|
|
10
|
+
/** Page content is loading - external resources (images, css, fonts) downloading. */
|
|
11
|
+
Loading = "loading",
|
|
12
|
+
/** The output is being produced (page.pdf() / screenshot). */
|
|
13
|
+
Rendering = "rendering",
|
|
14
|
+
/** Render finished successfully. */
|
|
15
|
+
Done = "done",
|
|
16
|
+
/** Render failed - `message` carries the reason. */
|
|
17
|
+
Failed = "failed"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A single progress snapshot delivered to a {@link RenderProgressCallback}.
|
|
21
|
+
* Resource counters are meaningful only for network-backed engines (puppeteer);
|
|
22
|
+
* they stay at 0 otherwise.
|
|
23
|
+
*/
|
|
24
|
+
export interface IRenderProgress {
|
|
25
|
+
/** Current render phase. */
|
|
26
|
+
phase: RenderPhase;
|
|
27
|
+
/** Best-effort completion, 0..100, weighted per phase. */
|
|
28
|
+
percent: number;
|
|
29
|
+
/** Resources whose response completed since loading started. */
|
|
30
|
+
resourcesLoaded: number;
|
|
31
|
+
/** Resources requested but not yet finished or failed. */
|
|
32
|
+
resourcesPending: number;
|
|
33
|
+
/** Resources that failed to load (e.g. broken images). */
|
|
34
|
+
resourcesFailed: number;
|
|
35
|
+
/** Milliseconds elapsed since the render started. */
|
|
36
|
+
elapsedMs: number;
|
|
37
|
+
/** Output file being produced. */
|
|
38
|
+
filePath: string;
|
|
39
|
+
/** Short human-readable status line. */
|
|
40
|
+
message?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Progress listener. Invoked fire-and-forget by the renderer - it is never
|
|
44
|
+
* awaited and any thrown error / rejected promise is swallowed, so a slow or
|
|
45
|
+
* faulty listener can neither stall nor break a render. Emissions are throttled.
|
|
46
|
+
*/
|
|
47
|
+
export type RenderProgressCallback = (progress: IRenderProgress) => void | Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional per-render options threaded through the {@link TemplateRenderer}
|
|
50
|
+
* contract and the {@link Templates} facade. All fields are optional; engines
|
|
51
|
+
* that do not support a given field ignore it.
|
|
52
|
+
*/
|
|
53
|
+
export interface IRenderOptions {
|
|
54
|
+
/** Receives throttled progress updates during the render. */
|
|
55
|
+
onProgress?: RenderProgressCallback;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/progress.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,WAAW;IACrB,oEAAoE;IACpE,QAAQ,aAAa;IACrB,iFAAiF;IACjF,SAAS,cAAc;IACvB,qFAAqF;IACrF,OAAO,YAAY;IACnB,8DAA8D;IAC9D,SAAS,cAAc;IACvB,oCAAoC;IACpC,IAAI,SAAS;IACb,oDAAoD;IACpD,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzF;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestones a (puppeteer) render passes through. Text engines complete
|
|
3
|
+
* synchronously and do not report phases.
|
|
4
|
+
*/
|
|
5
|
+
export var RenderPhase;
|
|
6
|
+
(function (RenderPhase) {
|
|
7
|
+
/** Local static server + pooled browser + page are being set up. */
|
|
8
|
+
RenderPhase["Starting"] = "starting";
|
|
9
|
+
/** HTML is being built (template compiled / raw HTML injected) - before load. */
|
|
10
|
+
RenderPhase["Preparing"] = "preparing";
|
|
11
|
+
/** Page content is loading - external resources (images, css, fonts) downloading. */
|
|
12
|
+
RenderPhase["Loading"] = "loading";
|
|
13
|
+
/** The output is being produced (page.pdf() / screenshot). */
|
|
14
|
+
RenderPhase["Rendering"] = "rendering";
|
|
15
|
+
/** Render finished successfully. */
|
|
16
|
+
RenderPhase["Done"] = "done";
|
|
17
|
+
/** Render failed - `message` carries the reason. */
|
|
18
|
+
RenderPhase["Failed"] = "failed";
|
|
19
|
+
})(RenderPhase || (RenderPhase = {}));
|
|
20
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/progress.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,oEAAoE;IACpE,oCAAqB,CAAA;IACrB,iFAAiF;IACjF,sCAAuB,CAAA;IACvB,qFAAqF;IACrF,kCAAmB,CAAA;IACnB,8DAA8D;IAC9D,sCAAuB,CAAA;IACvB,oCAAoC;IACpC,4BAAa,CAAA;IACb,oDAAoD;IACpD,gCAAiB,CAAA;AACnB,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB"}
|