spyne 0.19.0 → 0.20.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/.eslintrc.js +4 -3
- package/.travis.yml +24 -11
- package/karma.conf.js +76 -86
- package/lib/spyne.esm.js +15 -0
- package/lib/spyne.esm.js.map +1 -0
- package/lib/spyne.umd.js +9565 -0
- package/package.json +46 -26
- package/rollup.config.js +26 -0
- package/src/spyne/channels/channel-fetch-class.js +39 -43
- package/src/spyne/channels/channel-payload-class.js +61 -74
- package/src/spyne/channels/channel-proxy.js +25 -26
- package/src/spyne/channels/channel.js +141 -149
- package/src/spyne/channels/channels-config.js +46 -47
- package/src/spyne/channels/channels-map.js +61 -65
- package/src/spyne/channels/spyne-channel-lifecycle.js +12 -12
- package/src/spyne/channels/spyne-channel-route.js +241 -250
- package/src/spyne/channels/spyne-channel-ui.js +213 -75
- package/src/spyne/channels/spyne-channel-window.js +157 -157
- package/src/spyne/spyne-app.js +32 -19
- package/src/spyne/spyne-plugins.js +55 -70
- package/src/spyne/spyne.js +23 -23
- package/src/spyne/utils/channel-config-validator.js +10 -10
- package/src/spyne/utils/channel-fetch-util.js +72 -55
- package/src/spyne/utils/channel-payload-filter.js +89 -100
- package/src/spyne/utils/deep-merge.js +31 -29
- package/src/spyne/utils/frp-tools.js +108 -92
- package/src/spyne/utils/gc.js +6 -6
- package/src/spyne/utils/mixins/base-core-mixins.js +17 -15
- package/src/spyne/utils/mixins/base-streams-mixins.js +9 -9
- package/src/spyne/utils/route-channel-updater.js +23 -29
- package/src/spyne/utils/safe-clone.js +40 -58
- package/src/spyne/utils/sanitize-html.js +35 -0
- package/src/spyne/utils/security-policy.js +11 -0
- package/src/spyne/utils/spyne-app-properties.js +110 -114
- package/src/spyne/utils/spyne-logger.js +4 -11
- package/src/spyne/utils/spyne-plugins-methods.js +38 -63
- package/src/spyne/utils/spyne-trait.js +33 -33
- package/src/spyne/utils/spyne-utils-channel-route-url.js +229 -153
- package/src/spyne/utils/spyne-utils-channel-route.js +128 -138
- package/src/spyne/utils/spyne-utils-channel-window.js +39 -39
- package/src/spyne/utils/viewstream-animations.js +12 -12
- package/src/spyne/utils/viewstream-observables.js +45 -45
- package/src/spyne/views/dom-element-template.js +111 -114
- package/src/spyne/views/dom-element.js +82 -84
- package/src/spyne/views/view-stream-broadcaster.js +66 -62
- package/src/spyne/views/view-stream-element.js +105 -106
- package/src/spyne/views/view-stream-payload.js +25 -27
- package/src/spyne/views/view-stream-selector.js +157 -163
- package/src/spyne/views/view-stream.js +416 -640
- package/src/tests/channels/channel-dom.test.js +15 -15
- package/src/tests/channels/channel-fetch.test.js +51 -62
- package/src/tests/channels/channel-payload-class.test.js +50 -63
- package/src/tests/channels/channel-payload-filter.test.js +133 -193
- package/src/tests/channels/channel-route.test.js +102 -112
- package/src/tests/channels/channel-stream-item.test.js +19 -19
- package/src/tests/channels/channel-ui.test.js +15 -27
- package/src/tests/channels/channel-util-dom.test.js +31 -31
- package/src/tests/channels/channel.test.js +20 -25
- package/src/tests/channels/route-utils.test.js +61 -66
- package/src/tests/channels/url-utils.test.js +151 -151
- package/src/tests/channels/view-stream-broadcaster.test.js +7 -7
- package/src/tests/import.test.js +5 -5
- package/src/tests/index.js +6 -7
- package/src/tests/index.test.js +6 -8
- package/src/tests/mocks/channel-payload-data.js +218 -220
- package/src/tests/mocks/enhancer.test.js +5 -5
- package/src/tests/mocks/payload-ui.js +87 -90
- package/src/tests/mocks/routes-data.js +264 -266
- package/src/tests/mocks/spyne-docs.mocks.js +3 -3
- package/src/tests/mocks/template-renderer.mocks.js +47 -47
- package/src/tests/mocks/utils-data.js +78 -79
- package/src/tests/mocks/viewstream-internal-payload.mocks.js +50 -50
- package/src/tests/mocks/window-events-arr.js +1 -1
- package/src/tests/package-json.spec.test.js +9 -0
- package/src/tests/spyne-app.test.js +15 -18
- package/src/tests/spyne-plugin.test.js +16 -20
- package/src/tests/utils/channel-action-filter.test.js +84 -86
- package/src/tests/utils/channel-data-packet-generator.unused.js +62 -86
- package/src/tests/utils/channel-fetch-util.test.js +64 -66
- package/src/tests/utils/frp-tools.test.js +19 -19
- package/src/tests/utils/plugins-methods.test.js +31 -55
- package/src/tests/utils/security.test.js +10 -0
- package/src/tests/utils/spyne-app-properties.test.js +4 -8
- package/src/tests/views/dom-el-selectors.test.js +112 -119
- package/src/tests/views/dom-el-template-proxy.test.js +7 -0
- package/src/tests/views/dom-el-template.test.js +186 -156
- package/src/tests/views/dom-el.test.js +58 -56
- package/src/tests/views/view-stream-enhancer-loader.test.js +2 -2
- package/src/tests/views/view-stream-enhancer.test.js +11 -11
- package/src/tests/views/view-stream.test.js +22 -33
- package/webpack.config.js +76 -67
- package/docs/-_%20Solves%20equations%20of%20the%20form%20a%20_%20x%20=%20b.html +0 -487
- package/docs/DomItem.html +0 -298
- package/docs/DomItem_DomItem.html +0 -314
- package/docs/ViewStream.html +0 -2249
- package/docs/ViewStream_ViewStream.html +0 -503
- package/docs/custom/css/jsdoc-viewstream.css +0 -377
- package/docs/custom/layout.tmpl +0 -47
- package/docs/dom-item.js.html +0 -213
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/global.html +0 -548
- package/docs/index-custom.html +0 -79
- package/docs/index.html +0 -82
- package/docs/jsdoc.config.json +0 -22
- package/docs/scripts/linenumber.js +0 -25
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/scripts/prettify/lang-css.js +0 -2
- package/docs/scripts/prettify/prettify.js +0 -28
- package/docs/styles/jsdoc-default.css +0 -358
- package/docs/styles/prettify-jsdoc.css +0 -111
- package/docs/styles/prettify-tomorrow.css +0 -132
- package/docs/view-stream.js.html +0 -767
package/.eslintrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
module.exports = {
|
|
3
|
-
"extends": "
|
|
3
|
+
"extends": "standard",
|
|
4
4
|
|
|
5
5
|
"globals": {
|
|
6
6
|
"requestAnimationFrame" : true
|
|
@@ -19,11 +19,12 @@ module.exports = {
|
|
|
19
19
|
"named": "never",
|
|
20
20
|
"asyncArrow": "never"
|
|
21
21
|
}],
|
|
22
|
-
|
|
22
|
+
'no-new': 'off',
|
|
23
|
+
'camelcase': 'off',
|
|
23
24
|
"no-unused-vars": ["error", { "caughtErrors": "none", "args": "none" }],
|
|
24
25
|
"arrow-spacing": ["error", { "before": true, "after": true }],
|
|
25
26
|
"no-return-assign": ["error", "except-parens"],
|
|
26
27
|
"no-multi-spaces": ["error", { exceptions: { "VariableDeclarator": true } }]
|
|
27
28
|
/*"class-methods-use-this": ["error", { "exceptMethods": ["foo"] }]*/
|
|
28
29
|
}
|
|
29
|
-
};
|
|
30
|
+
};
|
package/.travis.yml
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
+
# .travis.yml
|
|
2
|
+
dist: jammy # or focal, etc.
|
|
1
3
|
language: node_js
|
|
2
|
-
|
|
3
|
-
directories:
|
|
4
|
-
- ~/.npm
|
|
5
|
-
services:
|
|
6
|
-
- xvfb
|
|
7
|
-
notifications:
|
|
8
|
-
email: false
|
|
4
|
+
|
|
9
5
|
node_js:
|
|
10
|
-
- '
|
|
11
|
-
|
|
12
|
-
-
|
|
6
|
+
- '16'
|
|
7
|
+
- '18'
|
|
8
|
+
- node # 'node' is the latest stable version
|
|
9
|
+
|
|
10
|
+
services:
|
|
11
|
+
- xvfb # If you need a browser environment
|
|
12
|
+
|
|
13
|
+
cache:
|
|
14
|
+
npm: true
|
|
15
|
+
|
|
16
|
+
before_install:
|
|
17
|
+
- npm install -g npm@latest
|
|
18
|
+
|
|
19
|
+
install:
|
|
20
|
+
- npm ci
|
|
21
|
+
|
|
13
22
|
script:
|
|
14
23
|
- npm run test:single
|
|
24
|
+
|
|
25
|
+
notifications:
|
|
26
|
+
email: false
|
|
27
|
+
|
|
15
28
|
branches:
|
|
16
29
|
only:
|
|
17
|
-
-
|
|
30
|
+
- main # Only build on 'main' branch
|
package/karma.conf.js
CHANGED
|
@@ -1,39 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
const webpackConfigs = require('./webpack.config');
|
|
2
|
+
|
|
3
|
+
// Since webpack.config.js exports an array [esmConfig, umdConfig],
|
|
4
|
+
// we'll grab the second one (UMD) to use in Karma.
|
|
5
|
+
const [esmConfig, umdConfig] = webpackConfigs || [];
|
|
6
|
+
|
|
7
|
+
// Make a shallow clone of the UMD config so we can tweak it for Karma:
|
|
8
|
+
const karmaWebpackConfig = {
|
|
9
|
+
...umdConfig,
|
|
10
|
+
|
|
11
|
+
// Force a "neutral" mode so Webpack doesn't minify or do env-specific optimizations
|
|
12
|
+
mode: 'none',
|
|
13
|
+
|
|
14
|
+
// Karma manages watching/rebuilding on its own, so we typically disable watch from Webpack
|
|
15
|
+
watch: false,
|
|
16
|
+
|
|
17
|
+
// Remove the library entry/output so that Karma can inline test files
|
|
18
|
+
entry: undefined,
|
|
19
|
+
output: undefined
|
|
20
|
+
};
|
|
21
|
+
karmaWebpackConfig.externals = [];
|
|
22
|
+
// Optionally inject any test-specific loaders/rules, e.g. coverage instrumentation:
|
|
23
|
+
karmaWebpackConfig.module.rules.push({
|
|
24
|
+
test: /\.js$/,
|
|
25
|
+
exclude: /node_modules/,
|
|
26
|
+
// If you use Babel or another coverage tool, you can add it here
|
|
27
|
+
// For example:
|
|
28
|
+
// use: {
|
|
29
|
+
// loader: 'babel-loader',
|
|
30
|
+
// options: {
|
|
31
|
+
// plugins: ['istanbul'] // coverage plugin
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
module.exports = function (config) {
|
|
37
|
+
// If you need Travis CI logic:
|
|
13
38
|
if (process.env.TRAVIS) {
|
|
14
|
-
config.browsers = ['
|
|
39
|
+
config.browsers = ['ChromeHeadlessNoSandbox'];
|
|
15
40
|
}
|
|
16
41
|
|
|
17
|
-
|
|
18
|
-
webpackConfig.module.rules.push(
|
|
19
|
-
{
|
|
20
|
-
test: /(\.js)$/,
|
|
21
|
-
exclude: /(node_modules)/
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
|
|
26
42
|
config.set({
|
|
27
|
-
|
|
28
|
-
// base path that will be used to resolve all patterns (eg. files, exclude)
|
|
43
|
+
// Base path that will be used to resolve all patterns (eg. files, exclude)
|
|
29
44
|
basePath: '',
|
|
30
45
|
|
|
31
|
-
|
|
32
|
-
output:{
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
46
|
+
// Test frameworks
|
|
37
47
|
frameworks: ['webpack', 'mocha', 'chai'],
|
|
38
48
|
|
|
39
49
|
plugins: [
|
|
@@ -44,90 +54,70 @@ module.exports = function(config) {
|
|
|
44
54
|
'karma-chrome-launcher'
|
|
45
55
|
],
|
|
46
56
|
|
|
47
|
-
|
|
57
|
+
// List of files / patterns to load in the browser
|
|
48
58
|
files: [
|
|
49
|
-
|
|
50
|
-
{ pattern: './node_modules/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{pattern: './src/tests/
|
|
55
|
-
{pattern: './src/tests/
|
|
56
|
-
|
|
57
|
-
{pattern: './src/tests/
|
|
58
|
-
{pattern: './src/tests/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
exclude: [
|
|
63
|
-
|
|
59
|
+
// External deps you might need:
|
|
60
|
+
{ pattern: './node_modules/ramda/dist/ramda.min.js', watched: false },
|
|
61
|
+
{ pattern: './node_modules/rxjs/**/*.js', included: false, watched: false },
|
|
62
|
+
|
|
63
|
+
// Your test files:
|
|
64
|
+
{ pattern: './src/tests/index.test.js', watched: true },
|
|
65
|
+
{ pattern: './src/tests/spyne-app.test.js', watched: true },
|
|
66
|
+
{ pattern: './src/tests/package-json.spec.test.js', watched: true },
|
|
67
|
+
{ pattern: './src/tests/spyne-plugin.test.js', watched: true },
|
|
68
|
+
{ pattern: './src/tests/channels/*.test.js', watched: true },
|
|
69
|
+
{ pattern: './src/tests/utils/*.test.js', watched: true },
|
|
70
|
+
{ pattern: './src/tests/views/*.test.js', watched: true }
|
|
64
71
|
],
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
// preprocess matching files before serving them to the browser
|
|
68
|
-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
73
|
+
// Preprocessors so that the files are processed by Webpack + coverage
|
|
69
74
|
preprocessors: {
|
|
70
|
-
|
|
71
|
-
'./src/tests/channels/*.test.js'
|
|
72
|
-
'./src/tests/utils/*.test.js'
|
|
73
|
-
'./src/tests/views/*.test.js'
|
|
75
|
+
'./src/tests/*.test.js': ['webpack', 'coverage'],
|
|
76
|
+
'./src/tests/channels/*.test.js': ['webpack', 'coverage'],
|
|
77
|
+
'./src/tests/utils/*.test.js': ['webpack', 'coverage'],
|
|
78
|
+
'./src/tests/views/*.test.js': ['webpack', 'coverage']
|
|
74
79
|
},
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
// Use our customized Webpack config
|
|
82
|
+
webpack: karmaWebpackConfig,
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
// Quiet the Webpack output in the Karma logs
|
|
85
|
+
webpackMiddleware: { noInfo: true },
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
// test results reporter to use
|
|
82
|
-
// possible values: 'dots', 'progress'
|
|
83
|
-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
87
|
+
// Report results with coverage
|
|
84
88
|
reporters: ['coverage'],
|
|
85
89
|
|
|
86
90
|
coverageReporter: {
|
|
87
91
|
reporters: [
|
|
88
|
-
//
|
|
89
|
-
{type:'
|
|
90
|
-
// generates ./coverage/coverage-final.json
|
|
91
|
-
{type:'json', subdir: '.'},
|
|
92
|
+
{ type: 'lcovonly', subdir: '.' }, // ./coverage/lcov.info
|
|
93
|
+
{ type: 'json', subdir: '.' } // ./coverage/coverage-final.json
|
|
92
94
|
]
|
|
93
95
|
},
|
|
94
96
|
|
|
95
|
-
// web server port
|
|
96
97
|
port: 9876,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// enable / disable colors in the output (reporters and logs)
|
|
100
98
|
colors: true,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// level of logging
|
|
104
|
-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
105
99
|
logLevel: config.LOG_DEBUG,
|
|
106
100
|
|
|
107
|
-
|
|
108
|
-
// enable / disable watching file and executing tests whenever any file changes
|
|
101
|
+
// autoWatch: if true, re-run tests on file changes
|
|
109
102
|
autoWatch: true,
|
|
103
|
+
|
|
104
|
+
// For file-watching inside containers or certain OS environments
|
|
110
105
|
usePolling: true,
|
|
111
106
|
|
|
112
107
|
customLaunchers: {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
ChromeHeadlessNoSandbox: {
|
|
109
|
+
base: 'ChromeHeadless',
|
|
110
|
+
flags: ['--no-sandbox']
|
|
111
|
+
}
|
|
118
112
|
},
|
|
119
113
|
|
|
120
|
-
|
|
121
|
-
// start these browsers
|
|
122
|
-
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
|
114
|
+
// Browsers to start (choose your launcher)
|
|
123
115
|
browsers: ['Chrome'],
|
|
124
116
|
|
|
125
|
-
//
|
|
126
|
-
// if true, Karma captures browsers, runs the tests and exits
|
|
117
|
+
// If true, Karma runs tests once and exits
|
|
127
118
|
singleRun: true,
|
|
128
119
|
|
|
129
120
|
// Concurrency level
|
|
130
|
-
// how many browser should be started simultaneous
|
|
131
121
|
concurrency: Infinity
|
|
132
|
-
})
|
|
133
|
-
}
|
|
122
|
+
});
|
|
123
|
+
};
|