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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npm run test:single
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npm run build && npm run build:esm
|
package/README.md
CHANGED
|
@@ -3,7 +3,9 @@ Spyne is a full-featured, Javascript framework that reactively renders to the Re
|
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/spyne)
|
|
5
5
|
[](https://github.com/spynejs/spyne/blob/master/LICENSE)
|
|
6
|
-
[](https://travis-ci.com/spynejs/spyne)
|
|
7
|
+
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
### Spyne.js’ key features includes:
|
|
9
11
|
|
package/karma.conf.js
CHANGED
|
@@ -1,62 +1,32 @@
|
|
|
1
|
-
const
|
|
1
|
+
const replace = require('@rollup/plugin-replace');
|
|
2
|
+
const dotenv = require('dotenv');
|
|
3
|
+
dotenv.config();
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
|
|
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
|
|
5
|
+
module.exports = function (config) {
|
|
6
|
+
// ...
|
|
7
|
+
// Use process.env.IS_PUBLIC as needed
|
|
8
|
+
// ...
|
|
20
9
|
};
|
|
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
10
|
|
|
36
11
|
module.exports = function (config) {
|
|
37
|
-
|
|
12
|
+
|
|
38
13
|
if (process.env.TRAVIS) {
|
|
39
14
|
config.browsers = ['ChromeHeadlessNoSandbox'];
|
|
40
15
|
}
|
|
41
16
|
|
|
42
17
|
config.set({
|
|
43
|
-
|
|
44
|
-
basePath: '',
|
|
45
|
-
|
|
46
|
-
// Test frameworks
|
|
47
|
-
frameworks: ['webpack', 'mocha', 'chai'],
|
|
18
|
+
frameworks: ['mocha', 'chai'],
|
|
48
19
|
|
|
20
|
+
// Load these plugins so Karma recognizes 'rollup' as a preprocessor
|
|
49
21
|
plugins: [
|
|
50
|
-
'karma-webpack',
|
|
51
22
|
'karma-mocha',
|
|
52
23
|
'karma-chai',
|
|
53
|
-
'karma-
|
|
54
|
-
'karma-
|
|
24
|
+
'karma-chrome-launcher',
|
|
25
|
+
'karma-rollup-preprocessor'
|
|
55
26
|
],
|
|
56
27
|
|
|
57
|
-
// List of files / patterns to load in the browser
|
|
58
28
|
files: [
|
|
59
|
-
//
|
|
29
|
+
// Test files
|
|
60
30
|
{ pattern: './node_modules/ramda/dist/ramda.min.js', watched: false },
|
|
61
31
|
{ pattern: './node_modules/rxjs/**/*.js', included: false, watched: false },
|
|
62
32
|
|
|
@@ -64,60 +34,46 @@ module.exports = function (config) {
|
|
|
64
34
|
{ pattern: './src/tests/index.test.js', watched: true },
|
|
65
35
|
{ pattern: './src/tests/spyne-app.test.js', watched: true },
|
|
66
36
|
{ pattern: './src/tests/package-json.spec.test.js', watched: true },
|
|
67
|
-
{ pattern: './src/tests/spyne-plugin.test.js', watched: true },
|
|
68
37
|
{ pattern: './src/tests/channels/*.test.js', watched: true },
|
|
69
38
|
{ pattern: './src/tests/utils/*.test.js', watched: true },
|
|
70
|
-
{ pattern: './src/tests/views/*.test.js', watched: true }
|
|
71
|
-
],
|
|
39
|
+
{ pattern: './src/tests/views/*.test.js', watched: true } ],
|
|
72
40
|
|
|
73
|
-
// Preprocessors so that the files are processed by Webpack + coverage
|
|
74
41
|
preprocessors: {
|
|
75
|
-
|
|
76
|
-
'./src/tests
|
|
77
|
-
'./src/tests/
|
|
78
|
-
'./src/tests/
|
|
42
|
+
// We want to run Rollup on our test files (and any imports they pull in)
|
|
43
|
+
'./src/tests/*.test.js': ['rollup'],
|
|
44
|
+
'./src/tests/channels/*.test.js': ['rollup'],
|
|
45
|
+
'./src/tests/utils/*.test.js': ['rollup'],
|
|
46
|
+
'./src/tests/views/*.test.js': ['rollup']
|
|
79
47
|
},
|
|
80
48
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
49
|
+
rollupPreprocessor: {
|
|
50
|
+
output: {
|
|
51
|
+
format: 'iife',
|
|
52
|
+
name: 'SpyneTest',
|
|
53
|
+
sourcemap: 'inline'
|
|
54
|
+
},
|
|
55
|
+
plugins: [
|
|
56
|
+
replace({
|
|
57
|
+
// The replacement you want to do:
|
|
58
|
+
'process.env.IS_PUBLIC': JSON.stringify(process.env.IS_PUBLIC === 'true'),
|
|
59
|
+
// Or if you'd rather fallback to 'false' if not set:
|
|
60
|
+
// 'process.env.IS_PUBLIC': JSON.stringify(process.env.IS_PUBLIC ?? 'false'),
|
|
61
|
+
|
|
62
|
+
preventAssignment: true
|
|
63
|
+
}),
|
|
64
|
+
|
|
65
|
+
require('@rollup/plugin-node-resolve').default(),
|
|
66
|
+
require('@rollup/plugin-commonjs')({
|
|
67
|
+
transformMixedEsModules: true
|
|
68
|
+
}),
|
|
69
|
+
require('@rollup/plugin-json')()
|
|
94
70
|
]
|
|
95
71
|
},
|
|
96
72
|
|
|
97
|
-
|
|
98
|
-
colors: true,
|
|
99
|
-
logLevel: config.LOG_DEBUG,
|
|
100
|
-
|
|
101
|
-
// autoWatch: if true, re-run tests on file changes
|
|
102
|
-
autoWatch: true,
|
|
103
|
-
|
|
104
|
-
// For file-watching inside containers or certain OS environments
|
|
105
|
-
usePolling: true,
|
|
106
|
-
|
|
107
|
-
customLaunchers: {
|
|
108
|
-
ChromeHeadlessNoSandbox: {
|
|
109
|
-
base: 'ChromeHeadless',
|
|
110
|
-
flags: ['--no-sandbox']
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
// Browsers to start (choose your launcher)
|
|
73
|
+
// Browsers
|
|
115
74
|
browsers: ['Chrome'],
|
|
116
75
|
|
|
117
|
-
//
|
|
118
|
-
singleRun: true
|
|
119
|
-
|
|
120
|
-
// Concurrency level
|
|
121
|
-
concurrency: Infinity
|
|
76
|
+
// run once and exit or watch
|
|
77
|
+
singleRun: true
|
|
122
78
|
});
|
|
123
79
|
};
|