@iebh/tera-fy 1.0.23 → 1.0.24

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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.0.24](https://github.com/IEBH/TERA-fy/compare/v1.0.23...v1.0.24) (2024-04-05)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Yet another fix for setProjectState() throwing when trying to save + remove defunct {sync:Boolean} option ([4e320ec](https://github.com/IEBH/TERA-fy/commit/4e320ec8f171237387db7404a7209b4ca51898c8))
11
+
5
12
  ## [1.0.23](https://github.com/IEBH/TERA-fy/compare/v1.0.22...v1.0.23) (2024-04-04)
6
13
 
7
14
  ## <small>1.0.22 (2024-04-04)</small>
package/api.md CHANGED
@@ -646,9 +646,8 @@ Paths can be any valid Lodash.set() value such as:
646
646
  * `options` **[Object][120]?** Additional options to mutate behaviour
647
647
 
648
648
  * `options.save` **[Boolean][127]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
649
- * `options.sync` **[Boolean][127]** Wait for the server to acknowledge the write, you almost never need to do this (optional, default `false`)
650
649
 
651
- Returns **[Promise][126]** A promise which resolves when the operation has synced with the server
650
+ Returns **[Promise][126]** A promise which resolves when the operation has been dispatched to the server
652
651
 
653
652
  ## setProjectStateDefaults
654
653
 
@@ -780,9 +780,8 @@ export default class TeraFy {
780
780
  *
781
781
  * @param {Object} [options] Additional options to mutate behaviour
782
782
  * @param {Boolean} [options.save=true] Save the changes to the server immediately, disable to queue up multiple writes
783
- * @param {Boolean} [options.sync=false] Wait for the server to acknowledge the write, you almost never need to do this
784
783
  *
785
- * @returns {Promise} A promise which resolves when the operation has synced with the server
784
+ * @returns {Promise} A promise which resolves when the operation has been dispatched to the server
786
785
  */
787
786
 
788
787
 
@@ -718,14 +718,12 @@ export default class TeraFyServer {
718
718
  *
719
719
  * @param {Object} [options] Additional options to mutate behaviour
720
720
  * @param {Boolean} [options.save=true] Save the changes to the server immediately, disable to queue up multiple writes
721
- * @param {Boolean} [options.sync=false] Wait for the server to acknowledge the write, you almost never need to do this
722
721
  *
723
- * @returns {Promise} A promise which resolves when the operation has synced with the server
722
+ * @returns {Promise} A promise which resolves when the operation has been dispatched to the server
724
723
  */
725
724
  setProjectState(path, value, options) {
726
725
  let settings = {
727
726
  save: true,
728
- sync: false,
729
727
  ...options,
730
728
  };
731
729
 
@@ -734,11 +732,8 @@ export default class TeraFyServer {
734
732
 
735
733
  this._pathSet(app.service('$projects').active, path, value);
736
734
 
737
- return (
738
- settings.save && settings.sync ? this.saveProjectState()
739
- : settings.save ? Promise.resolve(void this.saveProjectState())
740
- : (()=> { throw new Error('setProjectState({sync: true, save: false}) makes no sense') })()
741
- );
735
+ return Promise.resolve()
736
+ .then(()=> settings.save && this.saveProjectState())
742
737
  }
743
738
 
744
739
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/tera-fy",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
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=.",
@@ -86,7 +86,8 @@
86
86
  },
87
87
  "commit-and-tag-version": {
88
88
  "scripts": {
89
- "prerelease": "npm run build && git add docs dist"
89
+ "prerelease": "npm run build && git add docs dist",
90
+ "postcommit": "npm publish"
90
91
  }
91
92
  },
92
93
  "eslintConfig": {