@jsreport/jsreport-assets
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -78,4 +78,2 @@ const util = require('util') | ||
reporter.beforeRenderListeners.insert({ after: 'scripts' }, definition.name, this, async (req, res) => { | ||
req.context.systemHelpers += assetHelpers + '\n' | ||
req.template.content = await evaluateAssets(reporter, definition, req.template.content, req) | ||
@@ -88,3 +86,7 @@ | ||
reporter.afterTemplatingEnginesExecutedListeners.add('assets', async (req, res) => { | ||
reporter.registerHelpersListeners.add(definition.name, (req) => { | ||
return assetHelpers | ||
}) | ||
reporter.afterTemplatingEnginesExecutedListeners.add(definition.name, async (req, res) => { | ||
const result = await evaluateAssets(reporter, definition, res.content.toString(), req) | ||
@@ -94,6 +96,6 @@ res.content = Buffer.from(result) | ||
reporter.initializeListeners.add('assets', async () => { | ||
reporter.initializeListeners.add(definition.name, async () => { | ||
assetHelpers = (await fs.readFile(path.join(__dirname, '../static/helpers.js'))).toString() | ||
if (reporter.beforeScriptListeners) { | ||
reporter.beforeScriptListeners.add('assets', function ({ script }, req) { | ||
reporter.beforeScriptListeners.add(definition.name, function ({ script }, req) { | ||
return evaluateAssets(reporter, definition, script.content, req).then(function (result) { | ||
@@ -100,0 +102,0 @@ script.content = result |
{ | ||
"name": "@jsreport/jsreport-assets", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "jsreport extension embedding static assets like fonts or helpers into the templates", | ||
@@ -44,7 +44,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"@jsreport/jsreport-core": "3.1.0", | ||
"@jsreport/jsreport-express": "3.1.0", | ||
"@jsreport/jsreport-core": "3.2.0", | ||
"@jsreport/jsreport-express": "3.2.0", | ||
"@jsreport/jsreport-handlebars": "3.0.0", | ||
"@jsreport/jsreport-jsrender": "3.0.0", | ||
"@jsreport/jsreport-scripts": "3.0.0", | ||
"@jsreport/jsreport-scripts": "3.0.1", | ||
"@jsreport/studio-dev": "3.0.1", | ||
@@ -55,3 +55,3 @@ "binary-extensions": "1.12.0", | ||
"should": "13.2.3", | ||
"standard": "16.0.3", | ||
"standard": "16.0.4", | ||
"supertest": "3.3.0" | ||
@@ -58,0 +58,0 @@ }, |
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
204557
3139