@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/tera-fy",
3
- "version": "1.5.0",
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
- "after:bump": "npm run build && git add api.md docs/ dist/"
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 (typeof pl[k] == 'object') { // Setting sub-objects - need to recurse these in Vue2
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, Array.isArray(pl[k]) ? [] : {});
147
+ this.Vue.set(target, k, {});
146
148
 
147
149
  this.merge(target[k], pl[k]);
148
150
  } else {