jsreport 3.0.0-beta.2 → 3.0.0
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 +5 -5
- package/example.server.js +13 -13
- package/index.js +39 -33
- package/lib/extendConfig.js +35 -35
- package/lib/main.js +20 -20
- package/package.json +104 -103
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# jsreport
|
|
2
|
-
|
|
3
|
-
**The main jsreport distribution package**
|
|
4
|
-
|
|
5
|
-
See the readme in the root of the monorepo [README](https://github.com/jsreport/jsreport/blob/master/README.md).
|
|
1
|
+
# jsreport
|
|
2
|
+
|
|
3
|
+
**The main jsreport distribution package**
|
|
4
|
+
|
|
5
|
+
See the readme in the root of the monorepo [README](https://github.com/jsreport/jsreport/blob/master/README.md).
|
package/example.server.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const jsreport = require('jsreport')()
|
|
2
|
-
|
|
3
|
-
if (process.env.JSREPORT_CLI) {
|
|
4
|
-
module.exports = jsreport
|
|
5
|
-
} else {
|
|
6
|
-
jsreport.init().then(() => {
|
|
7
|
-
// running
|
|
8
|
-
}).catch((e) => {
|
|
9
|
-
// error during startup
|
|
10
|
-
console.error(e.stack)
|
|
11
|
-
process.exit(1)
|
|
12
|
-
})
|
|
13
|
-
}
|
|
1
|
+
const jsreport = require('jsreport')()
|
|
2
|
+
|
|
3
|
+
if (process.env.JSREPORT_CLI) {
|
|
4
|
+
module.exports = jsreport
|
|
5
|
+
} else {
|
|
6
|
+
jsreport.init().then(() => {
|
|
7
|
+
// running
|
|
8
|
+
}).catch((e) => {
|
|
9
|
+
// error during startup
|
|
10
|
+
console.error(e.stack)
|
|
11
|
+
process.exit(1)
|
|
12
|
+
})
|
|
13
|
+
}
|
package/index.js
CHANGED
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
/*!
|
|
4
|
-
* Copyright(c) 2018 Jan Blaha
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const semver = require('semver')
|
|
8
|
-
const packageJson = require('./package.json')
|
|
9
|
-
|
|
10
|
-
if (!semver.satisfies(process.versions.node, packageJson.engines.node)) {
|
|
11
|
-
console.error(
|
|
12
|
-
'jsreport requires to have installed a nodejs version of at least ' +
|
|
13
|
-
packageJson.engines.node +
|
|
14
|
-
' but you have installed version ' + process.versions.node + '. please update your nodejs version and try again'
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
process.exit(1)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const path = require('path')
|
|
21
|
-
const core = require('@jsreport/jsreport-core')
|
|
22
|
-
const main = require('./lib/main')
|
|
23
|
-
|
|
24
|
-
module.exports = function (options, defaults) {
|
|
25
|
-
options = options || {}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright(c) 2018 Jan Blaha
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const semver = require('semver')
|
|
8
|
+
const packageJson = require('./package.json')
|
|
9
|
+
|
|
10
|
+
if (!semver.satisfies(process.versions.node, packageJson.engines.node)) {
|
|
11
|
+
console.error(
|
|
12
|
+
'jsreport requires to have installed a nodejs version of at least ' +
|
|
13
|
+
packageJson.engines.node +
|
|
14
|
+
' but you have installed version ' + process.versions.node + '. please update your nodejs version and try again'
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
process.exit(1)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const path = require('path')
|
|
21
|
+
const core = require('@jsreport/jsreport-core')
|
|
22
|
+
const main = require('./lib/main')
|
|
23
|
+
|
|
24
|
+
module.exports = function (options, defaults) {
|
|
25
|
+
options = options || {}
|
|
26
|
+
|
|
27
|
+
// when jsreport is loaded from ESM, module.parent does not exists
|
|
28
|
+
if (module.parent) {
|
|
29
|
+
options.parentModuleDirectory = path.dirname(module.parent.filename)
|
|
30
|
+
} else {
|
|
31
|
+
// we set empty value to ensure jsreport-core does not override it with its custom default
|
|
32
|
+
options.parentModuleDirectory = ''
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return main(options, defaults)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports.Reporter = core.Reporter
|
|
39
|
+
module.exports.core = core
|
package/lib/extendConfig.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
const { loggerFormat, createDefaultLoggerFormat } = require('@jsreport/jsreport-core')
|
|
2
|
-
const defaultLoggerFormatWithTimestamp = createDefaultLoggerFormat({ timestamp: true })
|
|
3
|
-
|
|
4
|
-
function addTransports (reporter) {
|
|
5
|
-
reporter.options.logger.console = Object.assign({
|
|
6
|
-
transport: 'console',
|
|
7
|
-
level: 'debug',
|
|
8
|
-
handleExceptions: true,
|
|
9
|
-
format: loggerFormat.combine(
|
|
10
|
-
loggerFormat.colorize(),
|
|
11
|
-
defaultLoggerFormatWithTimestamp()
|
|
12
|
-
)
|
|
13
|
-
}, reporter.options.logger.console)
|
|
14
|
-
|
|
15
|
-
reporter.options.logger.file = Object.assign({
|
|
16
|
-
transport: 'file',
|
|
17
|
-
level: 'debug',
|
|
18
|
-
filename: 'logs/reporter.log',
|
|
19
|
-
maxsize: 10485760,
|
|
20
|
-
handleExceptions: true
|
|
21
|
-
}, reporter.options.logger.file)
|
|
22
|
-
|
|
23
|
-
reporter.options.logger.error = Object.assign({
|
|
24
|
-
transport: 'file',
|
|
25
|
-
level: 'error',
|
|
26
|
-
filename: 'logs/error.log',
|
|
27
|
-
handleExceptions: true
|
|
28
|
-
}, reporter.options.logger.error)
|
|
29
|
-
|
|
30
|
-
// nothing else to do here, winston creates the directory specified in file transport .filename automatically
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = (reporter) => {
|
|
34
|
-
addTransports(reporter)
|
|
35
|
-
}
|
|
1
|
+
const { loggerFormat, createDefaultLoggerFormat } = require('@jsreport/jsreport-core')
|
|
2
|
+
const defaultLoggerFormatWithTimestamp = createDefaultLoggerFormat({ timestamp: true })
|
|
3
|
+
|
|
4
|
+
function addTransports (reporter) {
|
|
5
|
+
reporter.options.logger.console = Object.assign({
|
|
6
|
+
transport: 'console',
|
|
7
|
+
level: 'debug',
|
|
8
|
+
handleExceptions: true,
|
|
9
|
+
format: loggerFormat.combine(
|
|
10
|
+
loggerFormat.colorize(),
|
|
11
|
+
defaultLoggerFormatWithTimestamp()
|
|
12
|
+
)
|
|
13
|
+
}, reporter.options.logger.console)
|
|
14
|
+
|
|
15
|
+
reporter.options.logger.file = Object.assign({
|
|
16
|
+
transport: 'file',
|
|
17
|
+
level: 'debug',
|
|
18
|
+
filename: 'logs/reporter.log',
|
|
19
|
+
maxsize: 10485760,
|
|
20
|
+
handleExceptions: true
|
|
21
|
+
}, reporter.options.logger.file)
|
|
22
|
+
|
|
23
|
+
reporter.options.logger.error = Object.assign({
|
|
24
|
+
transport: 'file',
|
|
25
|
+
level: 'error',
|
|
26
|
+
filename: 'logs/error.log',
|
|
27
|
+
handleExceptions: true
|
|
28
|
+
}, reporter.options.logger.error)
|
|
29
|
+
|
|
30
|
+
// nothing else to do here, winston creates the directory specified in file transport .filename automatically
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = (reporter) => {
|
|
34
|
+
addTransports(reporter)
|
|
35
|
+
}
|
package/lib/main.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const core = require('@jsreport/jsreport-core')
|
|
3
|
-
const packageJson = require('../package.json')
|
|
4
|
-
const extendConfig = require('./extendConfig')
|
|
5
|
-
|
|
6
|
-
module.exports = (options, defaults) => {
|
|
7
|
-
options = options || {}
|
|
8
|
-
|
|
9
|
-
const defaultsToUse = Object.assign({}, {
|
|
10
|
-
discover: true,
|
|
11
|
-
rootDirectory: path.join(__dirname, '../../../'),
|
|
12
|
-
loadConfig: true
|
|
13
|
-
}, defaults)
|
|
14
|
-
|
|
15
|
-
const reporter = core(options, defaultsToUse)
|
|
16
|
-
|
|
17
|
-
reporter.version = packageJson.version
|
|
18
|
-
|
|
19
|
-
return reporter.afterConfigLoaded(extendConfig)
|
|
20
|
-
}
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const core = require('@jsreport/jsreport-core')
|
|
3
|
+
const packageJson = require('../package.json')
|
|
4
|
+
const extendConfig = require('./extendConfig')
|
|
5
|
+
|
|
6
|
+
module.exports = (options, defaults) => {
|
|
7
|
+
options = options || {}
|
|
8
|
+
|
|
9
|
+
const defaultsToUse = Object.assign({}, {
|
|
10
|
+
discover: true,
|
|
11
|
+
rootDirectory: path.join(__dirname, '../../../'),
|
|
12
|
+
loadConfig: true
|
|
13
|
+
}, defaults)
|
|
14
|
+
|
|
15
|
+
const reporter = core(options, defaultsToUse)
|
|
16
|
+
|
|
17
|
+
reporter.version = packageJson.version
|
|
18
|
+
|
|
19
|
+
return reporter.afterConfigLoaded(extendConfig)
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,103 +1,104 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jsreport",
|
|
3
|
-
"version": "3.0.0
|
|
4
|
-
"description": "javascript based business reporting",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"report",
|
|
7
|
-
"business",
|
|
8
|
-
"javascript"
|
|
9
|
-
],
|
|
10
|
-
"homepage": "https://github.com/jsreport/jsreport",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/jsreport/jsreport/issues"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git@github.com:jsreport/jsreport.git"
|
|
17
|
-
},
|
|
18
|
-
"license": "LGPL",
|
|
19
|
-
"author": {
|
|
20
|
-
"name": "Jan Blaha",
|
|
21
|
-
"email": "jan.blaha@hotmail.com"
|
|
22
|
-
},
|
|
23
|
-
"contributors": [
|
|
24
|
-
{
|
|
25
|
-
"name": "BJR Matos",
|
|
26
|
-
"email": "bjrmatos@gmail.com",
|
|
27
|
-
"url": "https://github.com/bjrmatos"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "Jan Blaha"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"main": "index.js",
|
|
34
|
-
"files": [
|
|
35
|
-
"lib",
|
|
36
|
-
"index.js",
|
|
37
|
-
"example.server.js"
|
|
38
|
-
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"test": "mocha test --timeout 35000 && standard"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"handlebars": "4.7.7",
|
|
44
|
-
"@jsreport/jsreport-assets": "3.0.0
|
|
45
|
-
"@jsreport/jsreport-authentication": "3.0.0
|
|
46
|
-
"@jsreport/jsreport-authorization": "3.0.
|
|
47
|
-
"@jsreport/jsreport-base": "3.0.0
|
|
48
|
-
"@jsreport/jsreport-browser-client": "3.0.0
|
|
49
|
-
"@jsreport/jsreport-child-templates": "3.0.0
|
|
50
|
-
"@jsreport/jsreport-chrome-pdf": "3.0.0
|
|
51
|
-
"@jsreport/jsreport-cli": "3.0.0
|
|
52
|
-
"@jsreport/jsreport-components": "3.0.0
|
|
53
|
-
"@jsreport/jsreport-core": "3.0.
|
|
54
|
-
"@jsreport/jsreport-data": "3.0.0
|
|
55
|
-
"@jsreport/jsreport-docx": "3.0.0
|
|
56
|
-
"@jsreport/jsreport-express": "3.0.0
|
|
57
|
-
"@jsreport/jsreport-freeze": "3.0.
|
|
58
|
-
"@jsreport/jsreport-fs-store": "3.0.0
|
|
59
|
-
"@jsreport/jsreport-handlebars": "3.0.0
|
|
60
|
-
"@jsreport/jsreport-html-to-xlsx": "3.0.0
|
|
61
|
-
"@jsreport/jsreport-import-export": "3.0.0
|
|
62
|
-
"@jsreport/jsreport-jsrender": "3.0.0
|
|
63
|
-
"@jsreport/jsreport-licensing": "3.0.
|
|
64
|
-
"@jsreport/jsreport-localization": "3.0.0
|
|
65
|
-
"@jsreport/jsreport-
|
|
66
|
-
"@jsreport/jsreport-
|
|
67
|
-
"@jsreport/jsreport-
|
|
68
|
-
"@jsreport/jsreport-
|
|
69
|
-
"@jsreport/jsreport-
|
|
70
|
-
"@jsreport/jsreport-
|
|
71
|
-
"@jsreport/jsreport-
|
|
72
|
-
"@jsreport/jsreport-
|
|
73
|
-
"@jsreport/jsreport-
|
|
74
|
-
"@jsreport/jsreport-studio
|
|
75
|
-
"@jsreport/jsreport-
|
|
76
|
-
"@jsreport/jsreport-
|
|
77
|
-
"@jsreport/jsreport-
|
|
78
|
-
"@jsreport/jsreport-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "jsreport",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "javascript based business reporting",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"report",
|
|
7
|
+
"business",
|
|
8
|
+
"javascript"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/jsreport/jsreport",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/jsreport/jsreport/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git@github.com:jsreport/jsreport.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "LGPL",
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "Jan Blaha",
|
|
21
|
+
"email": "jan.blaha@hotmail.com"
|
|
22
|
+
},
|
|
23
|
+
"contributors": [
|
|
24
|
+
{
|
|
25
|
+
"name": "BJR Matos",
|
|
26
|
+
"email": "bjrmatos@gmail.com",
|
|
27
|
+
"url": "https://github.com/bjrmatos"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "Jan Blaha"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"main": "index.js",
|
|
34
|
+
"files": [
|
|
35
|
+
"lib",
|
|
36
|
+
"index.js",
|
|
37
|
+
"example.server.js"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"test": "mocha test --timeout 35000 && standard"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"handlebars": "4.7.7",
|
|
44
|
+
"@jsreport/jsreport-assets": "3.0.0",
|
|
45
|
+
"@jsreport/jsreport-authentication": "3.0.0",
|
|
46
|
+
"@jsreport/jsreport-authorization": "3.0.1",
|
|
47
|
+
"@jsreport/jsreport-base": "3.0.0",
|
|
48
|
+
"@jsreport/jsreport-browser-client": "3.0.0",
|
|
49
|
+
"@jsreport/jsreport-child-templates": "3.0.0",
|
|
50
|
+
"@jsreport/jsreport-chrome-pdf": "3.0.0",
|
|
51
|
+
"@jsreport/jsreport-cli": "3.0.0",
|
|
52
|
+
"@jsreport/jsreport-components": "3.0.0",
|
|
53
|
+
"@jsreport/jsreport-core": "3.0.1",
|
|
54
|
+
"@jsreport/jsreport-data": "3.0.0",
|
|
55
|
+
"@jsreport/jsreport-docx": "3.0.0",
|
|
56
|
+
"@jsreport/jsreport-express": "3.0.0",
|
|
57
|
+
"@jsreport/jsreport-freeze": "3.0.1",
|
|
58
|
+
"@jsreport/jsreport-fs-store": "3.0.0",
|
|
59
|
+
"@jsreport/jsreport-handlebars": "3.0.0",
|
|
60
|
+
"@jsreport/jsreport-html-to-xlsx": "3.0.0",
|
|
61
|
+
"@jsreport/jsreport-import-export": "3.0.0",
|
|
62
|
+
"@jsreport/jsreport-jsrender": "3.0.0",
|
|
63
|
+
"@jsreport/jsreport-licensing": "3.0.1",
|
|
64
|
+
"@jsreport/jsreport-localization": "3.0.0",
|
|
65
|
+
"@jsreport/jsreport-npm": "3.0.0",
|
|
66
|
+
"@jsreport/jsreport-pdf-utils": "3.0.0",
|
|
67
|
+
"@jsreport/jsreport-pptx": "3.0.0",
|
|
68
|
+
"@jsreport/jsreport-public-templates": "3.0.0",
|
|
69
|
+
"@jsreport/jsreport-reports": "3.0.0",
|
|
70
|
+
"@jsreport/jsreport-sample-template": "3.0.0",
|
|
71
|
+
"@jsreport/jsreport-scheduling": "3.0.0",
|
|
72
|
+
"@jsreport/jsreport-scripts": "3.0.0",
|
|
73
|
+
"@jsreport/jsreport-static-pdf": "3.0.0",
|
|
74
|
+
"@jsreport/jsreport-studio": "3.0.0",
|
|
75
|
+
"@jsreport/jsreport-studio-theme-dark": "3.0.0",
|
|
76
|
+
"@jsreport/jsreport-tags": "3.0.0",
|
|
77
|
+
"@jsreport/jsreport-text": "3.0.0",
|
|
78
|
+
"@jsreport/jsreport-version-control": "3.0.0",
|
|
79
|
+
"@jsreport/jsreport-xlsx": "3.0.0",
|
|
80
|
+
"puppeteer": "10.4.0",
|
|
81
|
+
"semver": "6.3.0"
|
|
82
|
+
},
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"mocha": "6.2.0",
|
|
85
|
+
"should": "13.2.3",
|
|
86
|
+
"standard": "16.0.3"
|
|
87
|
+
},
|
|
88
|
+
"engines": {
|
|
89
|
+
"node": ">=16.11"
|
|
90
|
+
},
|
|
91
|
+
"jsreport": {
|
|
92
|
+
"entryPoint": "server.js"
|
|
93
|
+
},
|
|
94
|
+
"standard": {
|
|
95
|
+
"ignore": [
|
|
96
|
+
"data/**"
|
|
97
|
+
],
|
|
98
|
+
"env": {
|
|
99
|
+
"mocha": true,
|
|
100
|
+
"browser": true,
|
|
101
|
+
"node": true
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|