spyne 0.20.1 → 0.20.4
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/.husky/pre-commit +1 -0
- package/.husky/pre-push +1 -0
- package/README.md +3 -1
- package/karma.conf.js +43 -87
- package/lib/spyne.esm.js +3 -5
- package/lib/{spyne.min.js.LICENSE.txt → spyne.esm.js.LICENSE.txt} +7 -1
- package/lib/spyne.esm.js.map +1 -1
- package/lib/spyne.umd.js +2 -2
- package/lib/spyne.umd.js.LICENSE.txt +2 -2
- package/package.json +10 -9
- package/rollup.config.js +1 -1
- package/src/spyne/spyne-app.js +3 -2
- package/src/spyne/spyne-plugins.js +45 -6
- package/src/spyne/utils/spyne-app-properties.js +11 -0
- package/src/spyne/utils/spyne-utils-channel-route.js +3 -3
- package/src/spyne/views/dom-element-template.js +5 -2
- package/src/spyne/views/dom-element.js +3 -2
- package/src/tests/channels/channel-fetch.test.js +8 -1
- package/src/tests/channels/channel-payload-class.test.js +2 -2
- package/src/tests/channels/channel-route.test.js +1 -2
- package/src/tests/channels/channel.test.js +5 -3
- package/src/tests/channels/route-utils.test.js +2 -3
- package/src/tests/channels/view-stream-broadcaster.test.js +1 -2
- package/src/tests/package-json.spec.test.js +17 -6
- package/src/tests/spyne-app.test.js +1 -1
- package/src/tests/views/dom-el-template-proxy.test.js +12 -5
- package/src/tests/views/dom-el-template.test.js +14 -14
- package/src/tests/views/dom-el.test.js +4 -4
- package/webpack.config.js +47 -38
- package/lib/spyne.js +0 -35300
- package/lib/spyne.min.js +0 -2
package/webpack.config.js
CHANGED
|
@@ -2,28 +2,16 @@
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const webpack = require('webpack');
|
|
4
4
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
|
5
|
-
const WebpackRxjsExternals = require('webpack-rxjs-externals');
|
|
6
5
|
const pkg = require('./package.json');
|
|
7
6
|
|
|
8
|
-
//
|
|
7
|
+
// Shared base config for the UMD build:
|
|
9
8
|
function baseConfig(mode) {
|
|
10
9
|
return {
|
|
11
10
|
mode,
|
|
12
11
|
devtool: mode === 'production' ? false : 'inline-source-map',
|
|
13
|
-
externals: [
|
|
14
|
-
WebpackRxjsExternals(),
|
|
15
|
-
{
|
|
16
|
-
ramda: {
|
|
17
|
-
commonjs: 'ramda',
|
|
18
|
-
commonjs2: 'ramda',
|
|
19
|
-
amd: 'ramda',
|
|
20
|
-
root: 'R'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
12
|
module: {
|
|
25
13
|
rules: [
|
|
26
|
-
//
|
|
14
|
+
// Example if you need Babel:
|
|
27
15
|
// {
|
|
28
16
|
// test: /\.js$/,
|
|
29
17
|
// exclude: /node_modules/,
|
|
@@ -36,7 +24,6 @@ function baseConfig(mode) {
|
|
|
36
24
|
modules: [path.resolve(__dirname, 'node_modules'), 'node_modules']
|
|
37
25
|
},
|
|
38
26
|
plugins: [
|
|
39
|
-
// Modern replacement for eslint-loader
|
|
40
27
|
new ESLintPlugin({
|
|
41
28
|
fix: true,
|
|
42
29
|
extensions: ['js'],
|
|
@@ -46,30 +33,18 @@ function baseConfig(mode) {
|
|
|
46
33
|
banner: `spynejs ${pkg.version}\nhttps://spynejs.org\n(c) 2017-present Frank Batista`,
|
|
47
34
|
entryOnly: true
|
|
48
35
|
})
|
|
49
|
-
]
|
|
36
|
+
],
|
|
37
|
+
optimization: {
|
|
38
|
+
// Disabling module concatenation helps avoid the “Cannot read properties of undefined” error
|
|
39
|
+
// when analyzing external modules for scope hoisting:
|
|
40
|
+
concatenateModules: false
|
|
41
|
+
}
|
|
50
42
|
};
|
|
51
43
|
}
|
|
52
44
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
entry: './src/spyne/spyne.js',
|
|
58
|
-
|
|
59
|
-
// Enable module output
|
|
60
|
-
experiments: {
|
|
61
|
-
outputModule: true
|
|
62
|
-
},
|
|
63
|
-
output: {
|
|
64
|
-
path: path.resolve(__dirname, 'lib'),
|
|
65
|
-
filename: 'spyne.esm.js',
|
|
66
|
-
library: {
|
|
67
|
-
type: 'module'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// UMD Build:
|
|
45
|
+
////////////////////////////////////////////////
|
|
46
|
+
// UMD Build Only (we rely on Rollup for ESM)
|
|
47
|
+
////////////////////////////////////////////////
|
|
73
48
|
const umdConfig = {
|
|
74
49
|
...baseConfig(process.env.NODE_ENV || 'development'),
|
|
75
50
|
|
|
@@ -81,8 +56,42 @@ const umdConfig = {
|
|
|
81
56
|
library: 'spyne',
|
|
82
57
|
libraryTarget: 'umd',
|
|
83
58
|
umdNamedDefine: true
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
///////////////////////////////////////////////////////////
|
|
62
|
+
// Externals for ramda, rxjs, dompurify, etc. in UMD build
|
|
63
|
+
///////////////////////////////////////////////////////////
|
|
64
|
+
externals: {
|
|
65
|
+
// Ramda
|
|
66
|
+
ramda: {
|
|
67
|
+
commonjs: 'ramda',
|
|
68
|
+
commonjs2: 'ramda',
|
|
69
|
+
amd: 'ramda',
|
|
70
|
+
root: 'R'
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// RxJS
|
|
74
|
+
rxjs: {
|
|
75
|
+
commonjs: 'rxjs',
|
|
76
|
+
commonjs2: 'rxjs',
|
|
77
|
+
amd: 'rxjs',
|
|
78
|
+
root: 'rxjs'
|
|
79
|
+
},
|
|
80
|
+
'rxjs/operators': {
|
|
81
|
+
commonjs: ['rxjs', 'operators'],
|
|
82
|
+
commonjs2: ['rxjs', 'operators'],
|
|
83
|
+
amd: 'rxjs/operators',
|
|
84
|
+
root: ['rxjs', 'operators']
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
// DOMPurify
|
|
88
|
+
dompurify: {
|
|
89
|
+
commonjs: 'dompurify',
|
|
90
|
+
commonjs2: 'dompurify',
|
|
91
|
+
amd: 'dompurify',
|
|
92
|
+
root: 'DOMPurify'
|
|
93
|
+
}
|
|
84
94
|
}
|
|
85
95
|
};
|
|
86
96
|
|
|
87
|
-
|
|
88
|
-
module.exports = [esmConfig, umdConfig];
|
|
97
|
+
module.exports = umdConfig;
|