From f93accc2bf6ad0609a175c27305a2da7d43a94c4 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Mon, 2 Mar 2020 19:12:01 -0800 Subject: [PATCH] chore(all): prepare release 1.6.0 --- dist/amd/aurelia-store.js | 15 ++++++++ dist/commonjs/aurelia-store.js | 15 ++++++++ dist/es2015/aurelia-store.js | 14 ++++++++ dist/es2017/aurelia-store.js | 14 ++++++++ dist/native-modules/aurelia-store.js | 15 ++++++++ dist/umd-es2015/aurelia-store.js | 14 ++++++++ dist/umd/aurelia-store.js | 15 ++++++++ doc/CHANGELOG.md | 51 ++++++++++++++++------------ package.json | 7 ++-- 9 files changed, 134 insertions(+), 26 deletions(-) diff --git a/dist/amd/aurelia-store.js b/dist/amd/aurelia-store.js index 1df2152..50bf34d 100644 --- a/dist/amd/aurelia-store.js +++ b/dist/amd/aurelia-store.js @@ -495,6 +495,21 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur this.devTools.init(this.initialState); this.devTools.subscribe(function (message) { _this.logger[getLogType(_this.options, "devToolsStatus", exports.LogLevel.debug)]("DevTools sent change " + message.type); + if (message.type === "ACTION" && message.payload) { + var byName = Array.from(_this.actions).find(function (_a) { + var reducer = _a[0]; + return reducer.name === message.payload.name; + }); + var action = _this.lookupAction(message.payload.name) || byName && byName[0]; + if (!action) { + throw new Error("Tried to remotely dispatch an unregistered action"); + } + if (!message.payload.args || message.payload.args.length < 1) { + throw new Error("No action arguments provided"); + } + _this.dispatch.apply(_this, [action].concat(message.payload.args.slice(1).map(function (arg) { return JSON.parse(arg); }))); + return; + } if (message.type === "DISPATCH" && message.payload) { switch (message.payload.type) { case "JUMP_TO_STATE": diff --git a/dist/commonjs/aurelia-store.js b/dist/commonjs/aurelia-store.js index 0573f5d..bd79383 100644 --- a/dist/commonjs/aurelia-store.js +++ b/dist/commonjs/aurelia-store.js @@ -503,6 +503,21 @@ var Store = /** @class */ (function () { this.devTools.init(this.initialState); this.devTools.subscribe(function (message) { _this.logger[getLogType(_this.options, "devToolsStatus", exports.LogLevel.debug)]("DevTools sent change " + message.type); + if (message.type === "ACTION" && message.payload) { + var byName = Array.from(_this.actions).find(function (_a) { + var reducer = _a[0]; + return reducer.name === message.payload.name; + }); + var action = _this.lookupAction(message.payload.name) || byName && byName[0]; + if (!action) { + throw new Error("Tried to remotely dispatch an unregistered action"); + } + if (!message.payload.args || message.payload.args.length < 1) { + throw new Error("No action arguments provided"); + } + _this.dispatch.apply(_this, [action].concat(message.payload.args.slice(1).map(function (arg) { return JSON.parse(arg); }))); + return; + } if (message.type === "DISPATCH" && message.payload) { switch (message.payload.type) { case "JUMP_TO_STATE": diff --git a/dist/es2015/aurelia-store.js b/dist/es2015/aurelia-store.js index 75c1a1d..78a5706 100644 --- a/dist/es2015/aurelia-store.js +++ b/dist/es2015/aurelia-store.js @@ -372,6 +372,20 @@ class Store { this.devTools.init(this.initialState); this.devTools.subscribe((message) => { this.logger[getLogType(this.options, "devToolsStatus", LogLevel.debug)](`DevTools sent change ${message.type}`); + if (message.type === "ACTION" && message.payload) { + const byName = Array.from(this.actions).find(function ([reducer]) { + return reducer.name === message.payload.name; + }); + const action = this.lookupAction(message.payload.name) || byName && byName[0]; + if (!action) { + throw new Error("Tried to remotely dispatch an unregistered action"); + } + if (!message.payload.args || message.payload.args.length < 1) { + throw new Error("No action arguments provided"); + } + this.dispatch(action, ...message.payload.args.slice(1).map((arg) => JSON.parse(arg))); + return; + } if (message.type === "DISPATCH" && message.payload) { switch (message.payload.type) { case "JUMP_TO_STATE": diff --git a/dist/es2017/aurelia-store.js b/dist/es2017/aurelia-store.js index 5e9a959..242287f 100644 --- a/dist/es2017/aurelia-store.js +++ b/dist/es2017/aurelia-store.js @@ -344,6 +344,20 @@ class Store { this.devTools.init(this.initialState); this.devTools.subscribe((message) => { this.logger[getLogType(this.options, "devToolsStatus", LogLevel.debug)](`DevTools sent change ${message.type}`); + if (message.type === "ACTION" && message.payload) { + const byName = Array.from(this.actions).find(function ([reducer]) { + return reducer.name === message.payload.name; + }); + const action = this.lookupAction(message.payload.name) || byName && byName[0]; + if (!action) { + throw new Error("Tried to remotely dispatch an unregistered action"); + } + if (!message.payload.args || message.payload.args.length < 1) { + throw new Error("No action arguments provided"); + } + this.dispatch(action, ...message.payload.args.slice(1).map((arg) => JSON.parse(arg))); + return; + } if (message.type === "DISPATCH" && message.payload) { switch (message.payload.type) { case "JUMP_TO_STATE": diff --git a/dist/native-modules/aurelia-store.js b/dist/native-modules/aurelia-store.js index 0251dc5..f760705 100644 --- a/dist/native-modules/aurelia-store.js +++ b/dist/native-modules/aurelia-store.js @@ -502,6 +502,21 @@ var Store = /** @class */ (function () { this.devTools.init(this.initialState); this.devTools.subscribe(function (message) { _this.logger[getLogType(_this.options, "devToolsStatus", LogLevel.debug)]("DevTools sent change " + message.type); + if (message.type === "ACTION" && message.payload) { + var byName = Array.from(_this.actions).find(function (_a) { + var reducer = _a[0]; + return reducer.name === message.payload.name; + }); + var action = _this.lookupAction(message.payload.name) || byName && byName[0]; + if (!action) { + throw new Error("Tried to remotely dispatch an unregistered action"); + } + if (!message.payload.args || message.payload.args.length < 1) { + throw new Error("No action arguments provided"); + } + _this.dispatch.apply(_this, [action].concat(message.payload.args.slice(1).map(function (arg) { return JSON.parse(arg); }))); + return; + } if (message.type === "DISPATCH" && message.payload) { switch (message.payload.type) { case "JUMP_TO_STATE": diff --git a/dist/umd-es2015/aurelia-store.js b/dist/umd-es2015/aurelia-store.js index 3ca4064..40f6e9a 100644 --- a/dist/umd-es2015/aurelia-store.js +++ b/dist/umd-es2015/aurelia-store.js @@ -369,6 +369,20 @@ this.devTools.init(this.initialState); this.devTools.subscribe((message) => { this.logger[getLogType(this.options, "devToolsStatus", exports.LogLevel.debug)](`DevTools sent change ${message.type}`); + if (message.type === "ACTION" && message.payload) { + const byName = Array.from(this.actions).find(function ([reducer]) { + return reducer.name === message.payload.name; + }); + const action = this.lookupAction(message.payload.name) || byName && byName[0]; + if (!action) { + throw new Error("Tried to remotely dispatch an unregistered action"); + } + if (!message.payload.args || message.payload.args.length < 1) { + throw new Error("No action arguments provided"); + } + this.dispatch(action, ...message.payload.args.slice(1).map((arg) => JSON.parse(arg))); + return; + } if (message.type === "DISPATCH" && message.payload) { switch (message.payload.type) { case "JUMP_TO_STATE": diff --git a/dist/umd/aurelia-store.js b/dist/umd/aurelia-store.js index f64bbc4..a687512 100644 --- a/dist/umd/aurelia-store.js +++ b/dist/umd/aurelia-store.js @@ -499,6 +499,21 @@ this.devTools.init(this.initialState); this.devTools.subscribe(function (message) { _this.logger[getLogType(_this.options, "devToolsStatus", exports.LogLevel.debug)]("DevTools sent change " + message.type); + if (message.type === "ACTION" && message.payload) { + var byName = Array.from(_this.actions).find(function (_a) { + var reducer = _a[0]; + return reducer.name === message.payload.name; + }); + var action = _this.lookupAction(message.payload.name) || byName && byName[0]; + if (!action) { + throw new Error("Tried to remotely dispatch an unregistered action"); + } + if (!message.payload.args || message.payload.args.length < 1) { + throw new Error("No action arguments provided"); + } + _this.dispatch.apply(_this, [action].concat(message.payload.args.slice(1).map(function (arg) { return JSON.parse(arg); }))); + return; + } if (message.type === "DISPATCH" && message.payload) { switch (message.payload.type) { case "JUMP_TO_STATE": diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 17067fa..844fccd 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,24 +1,33 @@ - -# [1.5.0](https://github.com/aurelia/store/compare/1.4.0...1.5.0) (2020-01-28) - - -### Features - -* **devtools:** implement redux devtools button handling ([#104](https://github.com/aurelia/store/issues/104)) ([86b7eda](https://github.com/aurelia/store/commit/86b7eda)) - - - - -# [1.4.0](https://github.com/aurelia/store/compare/1.3.5...1.4.0) (2019-06-12) - - -### Features - -* **dispatch:** piped dispatch ([4a78ad5](https://github.com/aurelia/store/commit/4a78ad5)) -* **polyfills:** ship with object.entries polyfill ([8ee1156](https://github.com/aurelia/store/commit/8ee1156)) - - - + +# [1.6.0](https://github.com/aurelia/store/compare/1.5.0...1.6.0) (2020-03-03) + + +### Features + +* **devtools:** basic dispatcher support ([ca97e85](https://github.com/aurelia/store/commit/ca97e85)) + + + +# [1.5.0](https://github.com/aurelia/store/compare/1.4.0...1.5.0) (2020-01-28) + + +### Features + +* **devtools:** implement redux devtools button handling ([#104](https://github.com/aurelia/store/issues/104)) ([86b7eda](https://github.com/aurelia/store/commit/86b7eda)) + + + + +# [1.4.0](https://github.com/aurelia/store/compare/1.3.5...1.4.0) (2019-06-12) + + +### Features + +* **dispatch:** piped dispatch ([4a78ad5](https://github.com/aurelia/store/commit/4a78ad5)) +* **polyfills:** ship with object.entries polyfill ([8ee1156](https://github.com/aurelia/store/commit/8ee1156)) + + + ## [1.3.5](https://github.com/aurelia/store/compare/1.3.4...1.3.5) (2019-05-29) diff --git a/package.json b/package.json index e8115a2..1acc9e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-store", - "version": "1.5.0", + "version": "1.6.0", "description": "Aurelia single state store based on RxJS", "keywords": [ "aurelia", @@ -23,13 +23,10 @@ "build": "cross-env TS_NODE_PROJECT=build/tsconfig.json ts-node build/build.ts", "bundle-dts": "dts-bundle-generator --project tsconfig-build.json -o dist/aurelia-store.d.ts src/aurelia-store.ts --external-types []", "precommit": "npm run lint", - "predoc": "cross-env rimraf doc/api.json && rimraf dist/doc-temp && tsc --p tsconfig-build.json --module amd --outFile dist/doc-temp/aurelia-store.js && node doc/shape-defs && copyfiles tsconfig.json dist/doc-temp", - "doc": "cross-env typedoc --json doc/api.json --excludeExternals --includeDeclarations --mode modules --target ES6 --name aurelia-store-docs dist/doc-temp/", - "postdoc": "cross-env node doc/shape-doc && rimraf dist/doc-temp", "changelog": "cross-env conventional-changelog -p angular -i doc/CHANGELOG.md -s", "bump-version": "npm --no-git-tag-version version", "preprepare-release": "cross-env npm run test", - "prepare-release": "cross-env npm run changelog && npm run build && npm run doc" + "prepare-release": "cross-env npm run changelog && npm run build" }, "jest": { "modulePaths": [