@iebh/tera-fy 1.5.0 → 1.6.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/CHANGELOG.md +19 -0
- package/api.md +267 -247
- package/dist/plugin.vue2.es2019.js +1 -1
- package/dist/terafy.es2019.js +1 -1
- package/dist/terafy.js +1 -1
- package/lib/terafy.client.js +30 -1
- package/lib/terafy.server.js +42 -2
- package/package.json +6 -3
- package/plugins/vue2.js +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iebh/tera-fy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "TERA website worker",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "esbuild --platform=browser --format=esm --bundle lib/terafy.client.js --outfile=dist/terafy.js --minify --serve --servedir=.",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build:docs:markdown": "documentation build lib/terafy.client.js lib/projectFile.js --format md --markdown-toc --output api.md",
|
|
13
13
|
"lint": "eslint lib plugins utils widgets",
|
|
14
14
|
"release": "release-it",
|
|
15
|
-
"watch": "nodemon --watch lib --exec npm run build"
|
|
15
|
+
"watch": "nodemon --watch lib --watch plugins --exec npm run build"
|
|
16
16
|
},
|
|
17
17
|
"type": "module",
|
|
18
18
|
"imports": {
|
|
@@ -109,7 +109,10 @@
|
|
|
109
109
|
},
|
|
110
110
|
"hooks": {
|
|
111
111
|
"before:init": "git reset HEAD -- api.md docs/ dist/",
|
|
112
|
-
"
|
|
112
|
+
"before:bump": [
|
|
113
|
+
"npm run build",
|
|
114
|
+
"git add api.md docs/ dist/"
|
|
115
|
+
]
|
|
113
116
|
},
|
|
114
117
|
"plugins": {
|
|
115
118
|
"@release-it/conventional-changelog": {
|
package/plugins/vue2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {cloneDeep} from 'lodash-es';
|
|
1
|
+
import {cloneDeep, isPlainObject} from 'lodash-es';
|
|
2
2
|
import TeraFyPluginBase from './base.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -93,6 +93,7 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
93
93
|
if (settings.read) {
|
|
94
94
|
this.events.on(`update:projects/${stateObservable.id}`, newState => {
|
|
95
95
|
skipUpdate++; // Skip next update as we're updating our own state anyway
|
|
96
|
+
this.debug('INFO', 5, 'Update Vue2 Remote->Local', {new: newState, old: stateObservable});
|
|
96
97
|
this.merge(stateObservable, newState);
|
|
97
98
|
});
|
|
98
99
|
}
|
|
@@ -114,6 +115,7 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
this.debug('INFO', 5, 'Update Vue2 Local->Remote', {new: newVal, old: oldVal});
|
|
117
119
|
this.createProjectStatePatch(newVal, oldVal);
|
|
118
120
|
oldVal = cloneDeep(snapshot);
|
|
119
121
|
},
|
|
@@ -140,9 +142,9 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
140
142
|
payload.forEach(pl =>
|
|
141
143
|
Object.keys(pl)
|
|
142
144
|
.forEach(k => {
|
|
143
|
-
if (
|
|
145
|
+
if (isPlainObject(pl[k])) { // Setting sub-objects - we need to recurse these in Vue2 in case a sub-key gets glued on
|
|
144
146
|
if (!(k in target)) // Destination to merge doesn't exist yet - create it
|
|
145
|
-
this.Vue.set(target, k,
|
|
147
|
+
this.Vue.set(target, k, {});
|
|
146
148
|
|
|
147
149
|
this.merge(target[k], pl[k]);
|
|
148
150
|
} else {
|