From 5fface976b65a6833b53e93d298878bb55d342fd Mon Sep 17 00:00:00 2001 From: torhex137 Date: Sat, 26 Jun 2021 00:12:35 -0600 Subject: [PATCH 01/15] added types packages --- dist/index.d.ts | 7 ++++- dist/index.js | 16 ++++++++--- dist/src/Controller.js | 3 ++- dist/src/Muon.js | 4 +-- dist/src/Proton.d.ts | 2 +- dist/src/components/View.d.ts | 1 - dist/src/components/View.js | 33 ----------------------- dist/src/resolver.d.ts | 12 +++------ dist/src/resolver.js | 23 +++++++++------- dist/src/store.js | 4 +-- index.ts | 17 +++++------- package-lock.json | 2 +- package.json | 3 +++ src/Atom.ts | 4 +-- src/Molecule.ts | 4 +-- src/Muon.ts | 31 +++++++++++++--------- src/components/View.ts | 17 ------------ src/resolver.ts | 35 +++++++++++------------- src/store.ts | 50 +++++++++++++++++++---------------- 19 files changed, 118 insertions(+), 150 deletions(-) delete mode 100644 dist/src/components/View.d.ts delete mode 100644 dist/src/components/View.js delete mode 100644 src/components/View.ts diff --git a/dist/index.d.ts b/dist/index.d.ts index cb0ff5c..fdfb686 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1 +1,6 @@ -export {}; +export { default as ApolloController } from "./src/ApolloController"; +export { default as Atom } from "./src/Atom"; +export { default as Controller } from "./src/Controller"; +export { default as Model } from "./src/Model"; +export { default as Molecule } from "./src/Molecule"; +export { default as store } from "./src/store"; diff --git a/dist/index.js b/dist/index.js index f3a26b9..008d34f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,5 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var dianmondHand = function () { - console.log("=====DiamondHand===="); -}; +exports.store = exports.Molecule = exports.Model = exports.Controller = exports.Atom = exports.ApolloController = void 0; +var ApolloController_1 = require("./src/ApolloController"); +Object.defineProperty(exports, "ApolloController", { enumerable: true, get: function () { return ApolloController_1.default; } }); +var Atom_1 = require("./src/Atom"); +Object.defineProperty(exports, "Atom", { enumerable: true, get: function () { return Atom_1.default; } }); +var Controller_1 = require("./src/Controller"); +Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return Controller_1.default; } }); +var Model_1 = require("./src/Model"); +Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return Model_1.default; } }); +var Molecule_1 = require("./src/Molecule"); +Object.defineProperty(exports, "Molecule", { enumerable: true, get: function () { return Molecule_1.default; } }); +var store_1 = require("./src/store"); +Object.defineProperty(exports, "store", { enumerable: true, get: function () { return store_1.default; } }); diff --git a/dist/src/Controller.js b/dist/src/Controller.js index f3a5459..12e7a98 100644 --- a/dist/src/Controller.js +++ b/dist/src/Controller.js @@ -58,7 +58,7 @@ var Controller = /** @class */ (function () { this._finishStack.push(f); return 'ok'; }; - // private + // protected Controller.prototype.controllerActionValid = function (action) { if (action === "" || action === undefined || action === null) { return console.error("🛂 Please pass in an attribute resolver defined on a model, such as user.ts `firstName`."); @@ -67,6 +67,7 @@ var Controller = /** @class */ (function () { return true; } }; + // private Controller.prototype.server = function () { var baseUrl = store_1.default.get("serverProps.env.server_url"); console.log("dev", "\uD83C\uDFA9 Server: " + baseUrl); diff --git a/dist/src/Muon.js b/dist/src/Muon.js index c3e6d9a..dd0dd21 100644 --- a/dist/src/Muon.js +++ b/dist/src/Muon.js @@ -44,7 +44,7 @@ var Muon = /** @class */ (function (_super) { } else { if (_this.isFetching()) - console.log("dev", "\uD83E\uDDE9", 'Fetching...'); + console.log("dev", "\uD83E\uDDE9", "Fetching..."); } } return value || ""; @@ -57,7 +57,7 @@ var Muon = /** @class */ (function (_super) { _this.reactSetState = _this.setState; _this.setState = function () { return _this.diamondHandsSetState.apply(_this, arguments); }; _this.state = { - value: "" + value: "", }; return _this; } diff --git a/dist/src/Proton.d.ts b/dist/src/Proton.d.ts index f7187b5..e806923 100644 --- a/dist/src/Proton.d.ts +++ b/dist/src/Proton.d.ts @@ -2,7 +2,7 @@ import Muan from "./Muon"; declare class Proton extends Muan { protected accelerate: () => void; protected onBlur: () => void; - protected isFinishedReq(): any; + protected isFinishedReq(): boolean; protected finishedReq: () => void; protected componentDidMount(): void; } diff --git a/dist/src/components/View.d.ts b/dist/src/components/View.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/src/components/View.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/src/components/View.js b/dist/src/components/View.js deleted file mode 100644 index 812ad01..0000000 --- a/dist/src/components/View.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var React = require("react"); -var Value = /** @class */ (function (_super) { - __extends(Value, _super); - function Value(props) { - var _this = _super.call(this, props) || this; - _this.state = { - attr: _this.props.attr, - model: _this.props.model - }; - return _this; - } - Value.prototype.render = function () { - return ({ this: .props.attr } < /span>); - }; - return Value; -}(React.Component)); diff --git a/dist/src/resolver.d.ts b/dist/src/resolver.d.ts index 5263f70..971064c 100644 --- a/dist/src/resolver.d.ts +++ b/dist/src/resolver.d.ts @@ -1,18 +1,12 @@ import Proton from "./Proton"; declare class Resolver extends Proton { - value(): { - this: any; - }; - edit(): { - this: any; - }; + value(): void; + edit(): void; query(variables: any): any; } -declare const resolver: ({ endpoint, model, attr, Value, Edit }: { +declare const resolver: ({ endpoint, model, attr }: { endpoint: any; model: any; attr: any; - Value: any; - Edit: any; }) => Resolver; export default resolver; diff --git a/dist/src/resolver.js b/dist/src/resolver.js index 4985544..1110aa6 100644 --- a/dist/src/resolver.js +++ b/dist/src/resolver.js @@ -15,7 +15,9 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); +// import * as React from "react"; var Proton_1 = require("./Proton"); +// import View from './components/View' var value = null; var Resolver = /** @class */ (function (_super) { __extends(Resolver, _super); @@ -24,32 +26,33 @@ var Resolver = /** @class */ (function (_super) { } Resolver.prototype.value = function () { var Value = this.props.Value; - return attr = { this: .attr }; - model = { this: .model } / > - ; + // return ( + // + // ) }; Resolver.prototype.edit = function () { var Edit = this.props.Edit; - return attr = { this: .attr }; - model = { this: .model } / > - ; + // return ( + // // + // ) }; Resolver.prototype.query = function (variables) { return this.model.controller.gqlAttribute({ client: this.model.controller.client(), action: this.props.attr, - variables: variables + variables: variables, }); }; return Resolver; }(Proton_1.default)); +// const resolver = ({ endpoint, model, attr, Value, Edit }) => { var resolver = function (_a) { - var endpoint = _a.endpoint, model = _a.model, attr = _a.attr, Value = _a.Value, Edit = _a.Edit; + var endpoint = _a.endpoint, model = _a.model, attr = _a.attr; return new Resolver({ model: model, attr: attr, - Value: Value, - Edit: Edit + // Value: Value, + // Edit: Edit, }); }; exports.default = resolver; diff --git a/dist/src/store.js b/dist/src/store.js index 270abfc..b3feafe 100644 --- a/dist/src/store.js +++ b/dist/src/store.js @@ -9,7 +9,7 @@ var Store = /** @class */ (function () { this.onUpdate = function (f) { console.log("all", "🥞 Store#onUpdate:", f); _this.onUpdateStack.push(f); - return 'ok'; + return "ok"; }; this.handleServerResponse = function (attr, model, res) { console.log("dev", "📜 Response:", res); @@ -71,7 +71,7 @@ var Store = /** @class */ (function () { if (this.isGraphql(model, attr)) { this.requestTracker[attr] = model.controller.gqlAttribute({ client: model.controller.client(), - action: attr + action: attr, }); } else { diff --git a/index.ts b/index.ts index f96138d..fdfb686 100644 --- a/index.ts +++ b/index.ts @@ -1,11 +1,6 @@ -import ApolloController from './src/ApolloController'; -import Atom from './src/Atom'; -import Model from './src/Model'; -import Muon from './src/Muon'; -import Proton from './src/Proton'; -import store from './src/store'; - - -const dianmondHand = () => { - console.log("=====DiamondHand===="); -} +export { default as ApolloController } from "./src/ApolloController"; +export { default as Atom } from "./src/Atom"; +export { default as Controller } from "./src/Controller"; +export { default as Model } from "./src/Model"; +export { default as Molecule } from "./src/Molecule"; +export { default as store } from "./src/store"; diff --git a/package-lock.json b/package-lock.json index f1b10b6..89ef3d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "diamondhands", - "version": "0.1.2", + "version": "0.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ac1a091..0b0bdbc 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.3", "description": "MVC OO React", "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "build": "tsc", "test": "echo \"Error: no test specified\" && exit 1" @@ -24,6 +25,8 @@ "homepage": "https://github.com/dezman/diamondhands#readme", "dependencies": { "@apollo/client": "^3.3.20", + "@types/graphql": "^14.5.0", + "@types/lodash": "^4.14.170", "@types/react": "^17.0.11", "isomorphic-fetch": "^3.0.0", "jquery": "^3.6.0" diff --git a/src/Atom.ts b/src/Atom.ts index f4cdd96..473c2e2 100644 --- a/src/Atom.ts +++ b/src/Atom.ts @@ -1,4 +1,4 @@ -import React from "react"; +import * as React from "react"; import store from "./store"; import Proton from "./Proton"; @@ -8,7 +8,7 @@ class Atom extends Proton { if (props.molecule) return; - if ( Object.keys(this.state).length !== 1 ) { + if (Object.keys(this.state).length !== 1) { console.error("↳ ⚛ Atoms can only have once piece of state. ⚛"); console.log("dev", this); } diff --git a/src/Molecule.ts b/src/Molecule.ts index d250802..79ceec0 100644 --- a/src/Molecule.ts +++ b/src/Molecule.ts @@ -1,11 +1,11 @@ -import React from "react"; +import * as React from "react"; import Atom from "./Atom"; class Molecule extends Atom { constructor(props) { super({ ...props, - molecule: true + molecule: true, }); } } diff --git a/src/Muon.ts b/src/Muon.ts index 016aa81..d97aff4 100644 --- a/src/Muon.ts +++ b/src/Muon.ts @@ -1,9 +1,13 @@ -import React from "react"; +import * as React from "react"; import store from "./store"; // Store <-> client state class Muon extends React.Component { - model; attr; storeKey; endpoint; reactSetState; + model; + attr; + storeKey; + endpoint; + reactSetState; constructor(props) { super(props); @@ -14,13 +18,13 @@ class Muon extends React.Component { this.endpoint = props.endpoint; store.onUpdate(this.refresh); - + this.reactSetState = this.setState; this.setState = () => this.diamondHandsSetState.apply(this, arguments); this.state = { - value: "" - } + value: "", + }; } protected quark() { @@ -28,7 +32,10 @@ class Muon extends React.Component { if (this.state.value.length) return this.state.value; if (!this.storeKey) { - console.log("dev", `🗝 You need a store key in your component to get a value.`); + console.log( + "dev", + `🗝 You need a store key in your component to get a value.` + ); console.log("dev", `↳`, this); } @@ -44,14 +51,14 @@ class Muon extends React.Component { } protected onChange = (e) => { - let newStoreState = {} + let newStoreState = {}; const newKeyValue = e.target.value; newStoreState[`${this.storeKey}`] = newKeyValue; store.set(newStoreState); this.setState({ value: newKeyValue }); - } + }; protected isFetching() { return this.proton && !this.isFinishedReq(); @@ -68,7 +75,7 @@ class Muon extends React.Component { if (!this.mounted) return; console.log("debug", "🌊 Muon refresh:", this.quark()); this.forceUpdate(); - } + }; private storeValue = () => { const value = store.get(this.storeKey); @@ -76,14 +83,14 @@ class Muon extends React.Component { if (this.attr) { console.log("debug", `🧬 Quark attr:`, this.attr); if (value) { - console.log("debug", `🧩` , `Quark value: ${value}`) + console.log("debug", `🧩`, `Quark value: ${value}`); } else { - if ( this.isFetching() ) console.log("dev", `🧩`, 'Fetching...'); + if (this.isFetching()) console.log("dev", `🧩`, "Fetching..."); } } return value || ""; - } + }; } export default Muon; diff --git a/src/components/View.ts b/src/components/View.ts deleted file mode 100644 index eca05f1..0000000 --- a/src/components/View.ts +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react"; - -class Value extends React.Component { - constructor(props) { - super(props); - this.state = { - attr: this.props.attr, - model: this.props.model - } - } - - render(){ - return( - { this.props.attr } - ) - } -} diff --git a/src/resolver.ts b/src/resolver.ts index 33fc993..d57cdcb 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -1,41 +1,38 @@ -import * as React from "react"; +// import * as React from "react"; import Proton from "./Proton"; import store from "./store"; -import View from './components/View' +// import View from './components/View' let value = null; class Resolver extends Proton { value() { const Value = this.props.Value; - return ( - - ) + // return ( + // + // ) } - edit() { const Edit = this.props.Edit; - return ( - - ) + // return ( + // // + // ) } - query(variables) { return this.model.controller.gqlAttribute({ client: this.model.controller.client(), - action: this.props.attr, - variables: variables + action: this.props.attr, + variables: variables, }); } } - -const resolver = ({endpoint, model, attr, Value, Edit}) => { +// const resolver = ({ endpoint, model, attr, Value, Edit }) => { +const resolver = ({ endpoint, model, attr }) => { return new Resolver({ model: model, attr: attr, - Value: Value, - Edit: Edit + // Value: Value, + // Edit: Edit, }); -} - -export default resolver +}; +export default resolver; diff --git a/src/store.ts b/src/store.ts index 549fe28..6d7a00a 100644 --- a/src/store.ts +++ b/src/store.ts @@ -14,16 +14,16 @@ class Store { public set(newState) { console.log("debug", "🚮 Old state:", this.state); console.log("debug", "💽 New state:", newState); - + // Object.assign not recommended for deep merge - this.state = _.merge(this.state, newState); + this.state = _.merge(this.state, newState); window.setTimeout(() => { console.log("dev", "🍱 Store state:", this.state); this.checkWaitFor(); - this.onUpdateStack.forEach( (f) => { + this.onUpdateStack.forEach((f) => { console.log("all", "🥞 Store onUpdateStack:", f); f(this.state); }); @@ -32,7 +32,7 @@ class Store { public get(passKey) { console.log("debug", "💅 Store#get:", passKey); - + if (!passKey || passKey === "") { console.error("🙈 Invalid store request: ", arguments); } @@ -48,16 +48,16 @@ class Store { console.error("🙈 Invalid store request: ", attr, model); } - model.controller.onFinishedFetching( (res) => { + model.controller.onFinishedFetching((res) => { this.handleServerResponse(attr, model, res); }); console.log("dev", "🌀 Starting get from server...", model.name, attr); - + if (this.isGraphql(model, attr)) { this.requestTracker[attr] = model.controller.gqlAttribute({ client: model.controller.client(), - action: attr + action: attr, }); } else { this.requestTracker[attr] = model.controller.getAttribute(attr); @@ -69,11 +69,11 @@ class Store { public waitFor(passKey, f) { const value = this.get(passKey); - if ( this.valid(value) ) { + if (this.valid(value)) { return f(value); } - if ( _.includes(this.waitingForKeys[passKey], f) ) { + if (_.includes(this.waitingForKeys[passKey], f)) { return; } @@ -87,20 +87,24 @@ class Store { public onUpdate = (f) => { console.log("all", "🥞 Store#onUpdate:", f); this.onUpdateStack.push(f); - return 'ok'; - } + return "ok"; + }; // private private checkWaitFor() { - console.log("debug", "🧳 Check wait for:", Object.keys(this.waitingForKeys)) + console.log( + "debug", + "🧳 Check wait for:", + Object.keys(this.waitingForKeys) + ); - Object.keys(this.waitingForKeys).forEach( (passKey) => { + Object.keys(this.waitingForKeys).forEach((passKey) => { const value = this.get(passKey); console.log("debug", "🧳 Value:", value); - if ( this.valid(value) ) { - this.waitingForKeys[passKey].forEach( (f) => { + if (this.valid(value)) { + this.waitingForKeys[passKey].forEach((f) => { console.log("debug", "🧳 Wait for callback called:", f); f(value); }); @@ -116,9 +120,9 @@ class Store { } private cacheKey(passKey) { - const cachedValue = _.get(this.state, passKey) - - if ( this.valid(cachedValue) ) { + const cachedValue = _.get(this.state, passKey); + + if (this.valid(cachedValue)) { console.log("debug", "💰 Cached value:", cachedValue); return cachedValue; } @@ -127,10 +131,10 @@ class Store { private handleServerResponse = (attr, model, res) => { console.log("dev", "📜 Response:", res); let newStateObj = {}; - + // Save new state to store - const relevantData = _(res).get( model.controller.accessor() ); - + const relevantData = _(res).get(model.controller.accessor()); + if (relevantData.results) { newStateObj[model.name] = newStateObj[model.name] || {}; newStateObj[model.name][attr] = relevantData.results; @@ -139,7 +143,7 @@ class Store { } this.set(newStateObj); - } + }; private valid(x) { console.log("debug", "🦆 Store#valid type:", typeof x); @@ -149,7 +153,7 @@ class Store { private debug = () => { if (this.state) console.log("dev", "🍱", this.state); return this.state; - } + }; } const initialState = {}; From 974aa8014d0baad0b5aa0d4d1928612d657d408c Mon Sep 17 00:00:00 2001 From: torhex137 Date: Sat, 26 Jun 2021 00:24:03 -0600 Subject: [PATCH 02/15] before tsc --init --- package.json | 1 + tsconfig.json | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0b0bdbc..93d8a22 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "dev": "tsc --watch", "build": "tsc", "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/tsconfig.json b/tsconfig.json index cef8923..0e13f93 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,8 +4,9 @@ "module": "commonjs", "declaration": true, "outDir": "./dist", - "strict": true + "strict": true, + "esModuleInterop": true }, "include": ["src", "index.ts"], "exclude": ["node_modules", "**/__tests__/*"] -} \ No newline at end of file +} From f442587dbff0f62f083c5a365011d1e7110d3f0f Mon Sep 17 00:00:00 2001 From: torhex137 Date: Sat, 26 Jun 2021 21:49:18 -0600 Subject: [PATCH 03/15] type errors at compile --- dist/index.d.ts | 8 +-- dist/index.js | 22 +++--- dist/src/ApolloController.d.ts | 17 +++-- dist/src/ApolloController.js | 76 +++++++------------- dist/src/Atom.js | 37 +++------- dist/src/Controller.d.ts | 6 +- dist/src/Controller.js | 101 ++++++++++++++------------- dist/src/Model.js | 46 ++++++------ dist/src/Molecule.js | 39 ++--------- dist/src/Muon.d.ts | 4 +- dist/src/Muon.js | 124 +++++++++++++++++---------------- dist/src/Proton.js | 75 ++++++++++---------- dist/src/resolver.js | 50 +++++-------- dist/src/store.js | 108 ++++++++++++++-------------- index.ts | 15 ++-- package-lock.json | 8 +++ package.json | 8 ++- src/ApolloController.ts | 44 +++++++----- src/Controller.ts | 64 +++++++++-------- src/Model.ts | 7 +- src/Muon.ts | 1 + src/Proton.ts | 7 +- src/store.ts | 2 + tsconfig.json | 74 ++++++++++++++++++-- 24 files changed, 474 insertions(+), 469 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index fdfb686..4cab553 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,6 +1,2 @@ -export { default as ApolloController } from "./src/ApolloController"; -export { default as Atom } from "./src/Atom"; -export { default as Controller } from "./src/Controller"; -export { default as Model } from "./src/Model"; -export { default as Molecule } from "./src/Molecule"; -export { default as store } from "./src/store"; +declare const _default: () => void; +export default _default; diff --git a/dist/index.js b/dist/index.js index 008d34f..93ddb6a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,15 +1,11 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.store = exports.Molecule = exports.Model = exports.Controller = exports.Atom = exports.ApolloController = void 0; -var ApolloController_1 = require("./src/ApolloController"); -Object.defineProperty(exports, "ApolloController", { enumerable: true, get: function () { return ApolloController_1.default; } }); -var Atom_1 = require("./src/Atom"); -Object.defineProperty(exports, "Atom", { enumerable: true, get: function () { return Atom_1.default; } }); -var Controller_1 = require("./src/Controller"); -Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return Controller_1.default; } }); -var Model_1 = require("./src/Model"); -Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return Model_1.default; } }); -var Molecule_1 = require("./src/Molecule"); -Object.defineProperty(exports, "Molecule", { enumerable: true, get: function () { return Molecule_1.default; } }); -var store_1 = require("./src/store"); -Object.defineProperty(exports, "store", { enumerable: true, get: function () { return store_1.default; } }); +// export { default as ApolloController } from "./src/ApolloController"; +// export { default as Atom } from "./src/Atom"; +// export { default as Controller } from "./src/Controller"; +// export { default as Model } from "./src/Model"; +// export { default as Molecule } from "./src/Molecule"; +// export { default as store } from "./src/store"; +exports.default = () => { + console.log("strawberry"); +}; diff --git a/dist/src/ApolloController.d.ts b/dist/src/ApolloController.d.ts index da27dcb..1577e93 100644 --- a/dist/src/ApolloController.d.ts +++ b/dist/src/ApolloController.d.ts @@ -1,13 +1,16 @@ -import Controller from './Controller'; -declare const setDiamondhandsClients: (obj: any) => void; +import Controller from "./Controller"; +declare const setDiamondhandsClients: (obj: { + client: string; +}) => void; +interface GqlAttr { + client: String; + action: String; + variables: any; +} declare class ApolloController extends Controller { constructor(); private baseQueryOptions; - gqlAttribute: ({ client, action, variables }: { - client: any; - action: any; - variables: any; - }) => any; + gqlAttribute: ({ client, action, variables }: GqlAttr) => Promise; private handleApolloError; private handleApolloSuccess; private queryOptions; diff --git a/dist/src/ApolloController.js b/dist/src/ApolloController.js index 6995e60..15c69d5 100644 --- a/dist/src/ApolloController.js +++ b/dist/src/ApolloController.js @@ -1,84 +1,58 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.setDiamondhandsClients = void 0; -var Controller_1 = require("./Controller"); -var diamondhandsClients = {}; -var setDiamondhandsClients = function (obj) { +const Controller_1 = __importDefault(require("./Controller")); +let diamondhandsClients = {}; +const setDiamondhandsClients = (obj) => { diamondhandsClients = obj; }; exports.setDiamondhandsClients = setDiamondhandsClients; -var ApolloController = /** @class */ (function (_super) { - __extends(ApolloController, _super); - function ApolloController() { - var _this = _super.call(this) || this; - _this.baseQueryOptions = { +class ApolloController extends Controller_1.default { + constructor() { + super(); + this.baseQueryOptions = { errorPolicy: "none", fetchPolicy: "cache-first", notifyOnNetworkStatusChange: true, returnPartialData: false, }; - _this.gqlAttribute = function (_a) { - var client = _a.client, action = _a.action, variables = _a.variables; - if (!_this.controllerActionValid(action)) + this.gqlAttribute = ({ client, action, variables }) => { + if (!this.controllerActionValid(action)) return; - console.log("dev", "🎛 Controller#gqlAttribute", "\uD83E\uDEA1 " + action); - var queryOptions = _this.queryOptions(action, variables); - var promise = new Promise(function (resolve, reject) { + console.log("dev", "🎛 Controller#gqlAttribute", `🪡 ${action}`); + const queryOptions = this.queryOptions(action, variables); + const promise = new Promise((resolve, reject) => { // GraphQL fetch - return diamondhandsClients[client].query(queryOptions) - .then(function (res) { return _this.handleApolloSuccess(res, resolve); }) - .catch(function (res) { return _this.handleApolloError(res, reject); }); + return diamondhandsClients(client) + .query(queryOptions) + .then((res) => this.handleApolloSuccess(res, resolve)) + .catch((res) => this.handleApolloError(res, reject)); }); return promise; }; // private - _this.handleApolloError = function (e, reject) { + this.handleApolloError = (e, reject) => { if (e.message.match("authentication")) { alert("🪵 Please log in to your server."); } console.error("⛔️ Error:", e); reject(e); }; - _this.handleApolloSuccess = function (res, resolve) { + this.handleApolloSuccess = (res, resolve) => { console.log("dev", "✅ Success:", res); resolve(res.data); - _this._finishStack.forEach(function (f) { + this._finishStack.forEach((f) => { f(res.data); }); }; - return _this; } - ApolloController.prototype.queryOptions = function (action, variables) { + queryOptions(action, variables) { if (variables) console.log("dev", "🔮 Query variables:", variables); - return __assign(__assign({}, this.baseQueryOptions), { query: this.requestBody(action), variables: variables, operationName: action }); - }; - return ApolloController; -}(Controller_1.default)); + return Object.assign(Object.assign({}, this.baseQueryOptions), { query: this.requestBody(action), variables: variables, operationName: action }); + } +} exports.default = ApolloController; diff --git a/dist/src/Atom.js b/dist/src/Atom.js index df12cb8..badba49 100644 --- a/dist/src/Atom.js +++ b/dist/src/Atom.js @@ -1,33 +1,18 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -var Proton_1 = require("./Proton"); -var Atom = /** @class */ (function (_super) { - __extends(Atom, _super); - function Atom(props) { - var _this = _super.call(this, props) || this; +const Proton_1 = __importDefault(require("./Proton")); +class Atom extends Proton_1.default { + constructor(props) { + super(props); if (props.molecule) - return _this; - if (Object.keys(_this.state).length !== 1) { + return; + if (Object.keys(this.state).length !== 1) { console.error("↳ ⚛ Atoms can only have once piece of state. ⚛"); - console.log("dev", _this); + console.log("dev", this); } - return _this; } - return Atom; -}(Proton_1.default)); +} exports.default = Atom; diff --git a/dist/src/Controller.d.ts b/dist/src/Controller.d.ts index dad3ae5..bcf07c7 100644 --- a/dist/src/Controller.d.ts +++ b/dist/src/Controller.d.ts @@ -1,8 +1,8 @@ declare class Controller { - _finishStack: never[]; + _finishStack: any[]; getAttribute(action: any): void; - basicFetch(path: any, body: any): any; - controllerFetch(method: any, path: any, body: any): any; + basicFetch(path: any, body: any): Promise; + controllerFetch(method: any, path: any, body: any): Promise; onFinishedFetching(f: any): string; protected requestBody: (action: any) => any; protected controllerActionValid(action: any): true | void; diff --git a/dist/src/Controller.js b/dist/src/Controller.js index 12e7a98..5f2a33a 100644 --- a/dist/src/Controller.js +++ b/dist/src/Controller.js @@ -1,103 +1,104 @@ "use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -var isomorphic_fetch_1 = require("isomorphic-fetch"); -var store_1 = require("./store"); -var Controller = /** @class */ (function () { - function Controller() { - var _this = this; +const isomorphic_fetch_1 = __importDefault(require("isomorphic-fetch")); +const store_1 = __importDefault(require("./store")); +// import $ from "jquery"; +class Controller { + constructor() { this._finishStack = []; - this.requestBody = function (action) { - var body = _this[action](); + this.requestBody = (action) => { + const body = this[action](); if (body) { - console.log("dev", "🌮 Request body:", body, _this); + console.log("dev", "🌮 Request body:", body, this); } else { - console.error("🍽 Empty request body:", body, _this); + console.error("🍽 Empty request body:", body, this); } return body; }; - this.success = function (res) { + this.success = (res) => { console.log("debug", "✅ Success:", res); - _this._finishStack.forEach(function (f) { + this._finishStack.forEach((f) => { f(res.data); }); - _this._finishStack = []; + this._finishStack = []; return res; }; - this.fail = function (res) { + this.fail = (res) => { console.log("dev", "❌ Fail:", res); console.log("dev", "🏗 Check your server & your ngrok tunnel."); return res; }; - this.always = function (res) { + this.always = (res) => { console.log("debug", "👾 Always:", res); return res; }; } - Controller.prototype.getAttribute = function (action) { + getAttribute(action) { if (!this.controllerActionValid(action)) return; - console.log("debug", "🎛 Controller#getAttribute", "\uD83E\uDEA1 " + action); + console.log("debug", "🎛 Controller#getAttribute", `🪡 ${action}`); // return this.controllerFetch( ...this.requestBody(action) ); console.warn("Not implimented yet"); - }; + } // Plain text fetch - Controller.prototype.basicFetch = function (path, body) { - return isomorphic_fetch_1.default(path, this.basicFetchOptions(body)) - .then(function (res) { return res.text(); }); - }; + basicFetch(path, body) { + return isomorphic_fetch_1.default(path, this.basicFetchOptions(body)).then((res) => res.text()); + } // Rest fetch - Controller.prototype.controllerFetch = function (method, path, body) { - return isomorphic_fetch_1.default("" + this.server() + path, this.fetchOptions(method, body)) - .then(function (res) { return res.json(); }) + controllerFetch(method, path, body) { + return isomorphic_fetch_1.default(`${this.server()}${path}`, this.fetchOptions(method, body)) + .then((res) => res.json()) .then(this.success) // https://github.com/github/fetch/issues/223#issuecomment-148927226 .catch(this.fail) .then(this.always, this.always); - }; - Controller.prototype.onFinishedFetching = function (f) { + } + onFinishedFetching(f) { this._finishStack.push(f); - return 'ok'; - }; + return "ok"; + } // protected - Controller.prototype.controllerActionValid = function (action) { + controllerActionValid(action) { if (action === "" || action === undefined || action === null) { return console.error("🛂 Please pass in an attribute resolver defined on a model, such as user.ts `firstName`."); } else { return true; } - }; + } // private - Controller.prototype.server = function () { - var baseUrl = store_1.default.get("serverProps.env.server_url"); - console.log("dev", "\uD83C\uDFA9 Server: " + baseUrl); + server() { + const baseUrl = store_1.default.get("serverProps.env.server_url"); + console.log("dev", `🎩 Server: ${baseUrl}`); return baseUrl; - }; - Controller.prototype.fetchOptions = function (method, body) { + } + fetchOptions(method, body) { return { method: method, - mode: 'cors', - cache: 'no-cache', + mode: "cors", + cache: "no-cache", headers: { - 'Content-Type': 'application/json; charset=UTF-8', - 'Accept': 'application/json', + "Content-Type": "application/json; charset=UTF-8", + Accept: "application/json", }, body: JSON.stringify(body), - credentials: 'include' + credentials: "include", }; - }; - Controller.prototype.basicFetchOptions = function (body) { + } + basicFetchOptions(body) { return { - method: 'GET', - mode: 'cors', - cache: 'no-cache', + method: "GET", + mode: "cors", + cache: "no-cache", headers: { - 'Content-Type': 'text/plain', + "Content-Type": "text/plain", }, body: body, - credentials: 'include' + credentials: "include", }; - }; - return Controller; -}()); + } +} exports.default = Controller; diff --git a/dist/src/Model.js b/dist/src/Model.js index ede6ae2..7a30120 100644 --- a/dist/src/Model.js +++ b/dist/src/Model.js @@ -1,34 +1,34 @@ "use strict"; // Validation logic +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -var resolver_1 = require("./resolver"); -var Model = /** @class */ (function () { - function Model(id) { - var _this = this; - // private - this.generateResolver = function (_a) { - var endpoint = _a.endpoint, attr = _a.attr, Value = _a.Value, Edit = _a.Edit; - console.log("dev", "👀 Resolver for:", [_this.name].concat(arguments)); - _this[attr] = resolver_1.default({ - endpoint: endpoint, - model: _this, - attr: attr, - Value: Value, - Edit: Edit - }); - }; +const resolver_1 = __importDefault(require("./resolver")); +class Model { + constructor(id) { this.id = id; this.data = {}; this.name = this.name(); this.resolvers().forEach(this.generateResolver); } - Model.prototype.hydrate = function (obj) { + hydrate(obj) { this.data = obj; return this; - }; - Model.prototype.getKey = function (attr) { - return this.name + "." + attr; - }; - return Model; -}()); + } + getKey(attr) { + return `${this.name}.${attr}`; + } + // private + generateResolver({ endpoint, attr, Value, Edit }) { + console.log("dev", "👀 Resolver for:", [this.name].concat(arguments)); + this[attr] = resolver_1.default({ + endpoint: endpoint, + model: this, + attr: attr, + Value: Value, + Edit: Edit, + }); + } +} exports.default = Model; diff --git a/dist/src/Molecule.js b/dist/src/Molecule.js index 80d3deb..945fab1 100644 --- a/dist/src/Molecule.js +++ b/dist/src/Molecule.js @@ -1,37 +1,12 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -var Atom_1 = require("./Atom"); -var Molecule = /** @class */ (function (_super) { - __extends(Molecule, _super); - function Molecule(props) { - return _super.call(this, __assign(__assign({}, props), { molecule: true })) || this; +const Atom_1 = __importDefault(require("./Atom")); +class Molecule extends Atom_1.default { + constructor(props) { + super(Object.assign(Object.assign({}, props), { molecule: true })); } - return Molecule; -}(Atom_1.default)); +} exports.default = Molecule; diff --git a/dist/src/Muon.d.ts b/dist/src/Muon.d.ts index 1bb20d4..73e01d1 100644 --- a/dist/src/Muon.d.ts +++ b/dist/src/Muon.d.ts @@ -4,13 +4,13 @@ declare class Muon extends React.Component { attr: any; storeKey: any; endpoint: any; - reactSetState: (state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined) => void; + reactSetState: any; constructor(props: any); protected quark(): any; protected componentDidMount(): void; protected componentWillUnmount(): void; protected onChange: (e: any) => void; - protected isFetching(): any; + protected isFetching(): boolean; private diamondHandsSetState; private refresh; private storeValue; diff --git a/dist/src/Muon.js b/dist/src/Muon.js index dd0dd21..c0a1f6b 100644 --- a/dist/src/Muon.js +++ b/dist/src/Muon.js @@ -1,91 +1,95 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -var React = require("react"); -var store_1 = require("./store"); +const React = __importStar(require("react")); +const store_1 = __importDefault(require("./store")); // Store <-> client state -var Muon = /** @class */ (function (_super) { - __extends(Muon, _super); - function Muon(props) { - var _this = _super.call(this, props) || this; - _this.onChange = function (e) { - var newStoreState = {}; - var newKeyValue = e.target.value; - newStoreState["" + _this.storeKey] = newKeyValue; +class Muon extends React.Component { + constructor(props) { + super(props); + this.onChange = (e) => { + let newStoreState = {}; + const newKeyValue = e.target.value; + newStoreState[`${this.storeKey}`] = newKeyValue; store_1.default.set(newStoreState); - _this.setState({ value: newKeyValue }); + this.setState({ value: newKeyValue }); }; - _this.refresh = function () { - if (!_this.mounted) + this.refresh = () => { + if (!this.mounted) return; - console.log("debug", "🌊 Muon refresh:", _this.quark()); - _this.forceUpdate(); + console.log("debug", "🌊 Muon refresh:", this.quark()); + this.forceUpdate(); }; - _this.storeValue = function () { - var value = store_1.default.get(_this.storeKey); - if (_this.attr) { - console.log("debug", "\uD83E\uDDEC Quark attr:", _this.attr); + this.storeValue = () => { + const value = store_1.default.get(this.storeKey); + if (this.attr) { + console.log("debug", `🧬 Quark attr:`, this.attr); if (value) { - console.log("debug", "\uD83E\uDDE9", "Quark value: " + value); + console.log("debug", `🧩`, `Quark value: ${value}`); } else { - if (_this.isFetching()) - console.log("dev", "\uD83E\uDDE9", "Fetching..."); + if (this.isFetching()) + console.log("dev", `🧩`, "Fetching..."); } } return value || ""; }; - _this.model = props.model; - _this.attr = props.attr; - _this.storeKey = props.storeKey || _this.model.getKey(_this.attr); - _this.endpoint = props.endpoint; - store_1.default.onUpdate(_this.refresh); - _this.reactSetState = _this.setState; - _this.setState = function () { return _this.diamondHandsSetState.apply(_this, arguments); }; - _this.state = { + this.model = props.model; + this.attr = props.attr; + this.storeKey = props.storeKey || this.model.getKey(this.attr); + this.endpoint = props.endpoint; + store_1.default.onUpdate(this.refresh); + this.reactSetState = this.setState; + this.setState = () => this.diamondHandsSetState.apply(this, arguments); + this.state = { value: "", }; - return _this; } - Muon.prototype.quark = function () { + quark() { // return if quark is already set if (this.state.value.length) return this.state.value; if (!this.storeKey) { - console.log("dev", "\uD83D\uDDDD You need a store key in your component to get a value."); - console.log("dev", "\u21B3", this); + console.log("dev", `🗝 You need a store key in your component to get a value.`); + console.log("dev", `↳`, this); } return this.storeValue(); - }; - Muon.prototype.componentDidMount = function () { + } + componentDidMount() { this.mounted = true; - }; - Muon.prototype.componentWillUnmount = function () { + } + componentWillUnmount() { this.mounted = false; - }; - Muon.prototype.isFetching = function () { + } + isFetching() { return this.proton && !this.isFinishedReq(); - }; + } // private - Muon.prototype.diamondHandsSetState = function (state) { + diamondHandsSetState(state) { if (!this.mounted) return; this.reactSetState(state); - }; - return Muon; -}(React.Component)); + } +} exports.default = Muon; diff --git a/dist/src/Proton.js b/dist/src/Proton.js index c7e85d6..29a26ce 100644 --- a/dist/src/Proton.js +++ b/dist/src/Proton.js @@ -1,48 +1,53 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -var store_1 = require("./store"); -var Muon_1 = require("./Muon"); +const store_1 = __importDefault(require("./store")); +const Muon_1 = __importDefault(require("./Muon")); +const _ = __importStar(require("lodash")); // Server <-> client state -var _finishedRequests = []; -var Proton = /** @class */ (function (_super) { - __extends(Proton, _super); - function Proton() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.accelerate = function () { - if (_this.attr) { - store_1.default.getFromServer(_this.model, _this.attr).then(_this.finishedReq); +const _finishedRequests = []; +class Proton extends Muon_1.default { + constructor() { + super(...arguments); + this.accelerate = () => { + if (this.attr) { + store_1.default.getFromServer(this.model, this.attr).then(this.finishedReq); } }; - _this.onBlur = function () { + this.onBlur = () => { // TODO: Save }; - _this.finishedReq = function () { - _finishedRequests.push(_this); + this.finishedReq = () => { + _finishedRequests.push(this); }; - return _this; } - Proton.prototype.isFinishedReq = function () { + isFinishedReq() { return _.includes(_finishedRequests, this); - }; - Proton.prototype.componentDidMount = function () { + } + componentDidMount() { this.mounted = true; this.accelerate(); - }; - return Proton; -}(Muon_1.default)); + } +} exports.default = Proton; diff --git a/dist/src/resolver.js b/dist/src/resolver.js index 1110aa6..263d185 100644 --- a/dist/src/resolver.js +++ b/dist/src/resolver.js @@ -1,53 +1,35 @@ "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); // import * as React from "react"; -var Proton_1 = require("./Proton"); +const Proton_1 = __importDefault(require("./Proton")); // import View from './components/View' -var value = null; -var Resolver = /** @class */ (function (_super) { - __extends(Resolver, _super); - function Resolver() { - return _super !== null && _super.apply(this, arguments) || this; - } - Resolver.prototype.value = function () { - var Value = this.props.Value; +let value = null; +class Resolver extends Proton_1.default { + value() { + const Value = this.props.Value; // return ( // // ) - }; - Resolver.prototype.edit = function () { - var Edit = this.props.Edit; + } + edit() { + const Edit = this.props.Edit; // return ( // // // ) - }; - Resolver.prototype.query = function (variables) { + } + query(variables) { return this.model.controller.gqlAttribute({ client: this.model.controller.client(), action: this.props.attr, variables: variables, }); - }; - return Resolver; -}(Proton_1.default)); + } +} // const resolver = ({ endpoint, model, attr, Value, Edit }) => { -var resolver = function (_a) { - var endpoint = _a.endpoint, model = _a.model, attr = _a.attr; +const resolver = ({ endpoint, model, attr }) => { return new Resolver({ model: model, attr: attr, diff --git a/dist/src/store.js b/dist/src/store.js index b3feafe..74b9846 100644 --- a/dist/src/store.js +++ b/dist/src/store.js @@ -1,21 +1,25 @@ "use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -var Store = /** @class */ (function () { - function Store(initialState) { - var _this = this; +// @ts-ignore +const lodash_1 = __importDefault(require("lodash")); +class Store { + constructor(initialState) { this.requestTracker = {}; this.onUpdateStack = []; this.waitingForKeys = {}; - this.onUpdate = function (f) { + this.onUpdate = (f) => { console.log("all", "🥞 Store#onUpdate:", f); - _this.onUpdateStack.push(f); + this.onUpdateStack.push(f); return "ok"; }; - this.handleServerResponse = function (attr, model, res) { + this.handleServerResponse = (attr, model, res) => { console.log("dev", "📜 Response:", res); - var newStateObj = {}; + let newStateObj = {}; // Save new state to store - var relevantData = _(res).get(model.controller.accessor()); + const relevantData = lodash_1.default(res).get(model.controller.accessor()); if (relevantData.results) { newStateObj[model.name] = newStateObj[model.name] || {}; newStateObj[model.name][attr] = relevantData.results; @@ -23,49 +27,47 @@ var Store = /** @class */ (function () { else { newStateObj[model.name] = relevantData; } - _this.set(newStateObj); + this.set(newStateObj); }; - this.debug = function () { - if (_this.state) - console.log("dev", "🍱", _this.state); - return _this.state; + this.debug = () => { + if (this.state) + console.log("dev", "🍱", this.state); + return this.state; }; this.state = initialState; console.log("debug", "🗺 Store ctx:", this); window.bug = this.debug; } - Store.prototype.set = function (newState) { - var _this = this; + set(newState) { console.log("debug", "🚮 Old state:", this.state); console.log("debug", "💽 New state:", newState); // Object.assign not recommended for deep merge - this.state = _.merge(this.state, newState); - window.setTimeout(function () { - console.log("dev", "🍱 Store state:", _this.state); - _this.checkWaitFor(); - _this.onUpdateStack.forEach(function (f) { + this.state = lodash_1.default.merge(this.state, newState); + window.setTimeout(() => { + console.log("dev", "🍱 Store state:", this.state); + this.checkWaitFor(); + this.onUpdateStack.forEach((f) => { console.log("all", "🥞 Store onUpdateStack:", f); - f(_this.state); + f(this.state); }); }, 0); - }; - Store.prototype.get = function (passKey) { + } + get(passKey) { console.log("debug", "💅 Store#get:", passKey); if (!passKey || passKey === "") { console.error("🙈 Invalid store request: ", arguments); } return this.cacheKey(passKey); - }; - Store.prototype.getFromServer = function (model, attr) { - var _this = this; + } + getFromServer(model, attr) { // Already requested it if (this.requestTracker[attr]) return this.requestTracker[attr]; if (!attr || !model) { console.error("🙈 Invalid store request: ", attr, model); } - model.controller.onFinishedFetching(function (res) { - _this.handleServerResponse(attr, model, res); + model.controller.onFinishedFetching((res) => { + this.handleServerResponse(attr, model, res); }); console.log("dev", "🌀 Starting get from server...", model.name, attr); if (this.isGraphql(model, attr)) { @@ -78,13 +80,13 @@ var Store = /** @class */ (function () { this.requestTracker[attr] = model.controller.getAttribute(attr); } return this.requestTracker[attr]; - }; - Store.prototype.waitFor = function (passKey, f) { - var value = this.get(passKey); + } + waitFor(passKey, f) { + const value = this.get(passKey); if (this.valid(value)) { return f(value); } - if (_.includes(this.waitingForKeys[passKey], f)) { + if (lodash_1.default.includes(this.waitingForKeys[passKey], f)) { return; } if (this.waitingForKeys[passKey]) { @@ -93,40 +95,38 @@ var Store = /** @class */ (function () { else { this.waitingForKeys[passKey] = [f]; } - }; + } // private - Store.prototype.checkWaitFor = function () { - var _this = this; + checkWaitFor() { console.log("debug", "🧳 Check wait for:", Object.keys(this.waitingForKeys)); - Object.keys(this.waitingForKeys).forEach(function (passKey) { - var value = _this.get(passKey); + Object.keys(this.waitingForKeys).forEach((passKey) => { + const value = this.get(passKey); console.log("debug", "🧳 Value:", value); - if (_this.valid(value)) { - _this.waitingForKeys[passKey].forEach(function (f) { + if (this.valid(value)) { + this.waitingForKeys[passKey].forEach((f) => { console.log("debug", "🧳 Wait for callback called:", f); f(value); }); - console.log("debug", "🧳 Destroyed:", _this.waitingForKeys[passKey]); - delete _this.waitingForKeys[passKey]; + console.log("debug", "🧳 Destroyed:", this.waitingForKeys[passKey]); + delete this.waitingForKeys[passKey]; } }); - }; - Store.prototype.isGraphql = function (model, attr) { + } + isGraphql(model, attr) { return model.controller.requestBody(attr).kind === "Document"; - }; - Store.prototype.cacheKey = function (passKey) { - var cachedValue = _.get(this.state, passKey); + } + cacheKey(passKey) { + const cachedValue = lodash_1.default.get(this.state, passKey); if (this.valid(cachedValue)) { console.log("debug", "💰 Cached value:", cachedValue); return cachedValue; } - }; - Store.prototype.valid = function (x) { + } + valid(x) { console.log("debug", "🦆 Store#valid type:", typeof x); - return !_.isNil(x) && !_.isNaN(x); - }; - return Store; -}()); -var initialState = {}; -var store = new Store(initialState); + return !lodash_1.default.isNil(x) && !lodash_1.default.isNaN(x); + } +} +const initialState = {}; +const store = new Store(initialState); exports.default = store; diff --git a/index.ts b/index.ts index fdfb686..c3de5a4 100644 --- a/index.ts +++ b/index.ts @@ -1,6 +1,9 @@ -export { default as ApolloController } from "./src/ApolloController"; -export { default as Atom } from "./src/Atom"; -export { default as Controller } from "./src/Controller"; -export { default as Model } from "./src/Model"; -export { default as Molecule } from "./src/Molecule"; -export { default as store } from "./src/store"; +// export { default as ApolloController } from "./src/ApolloController"; +// export { default as Atom } from "./src/Atom"; +// export { default as Controller } from "./src/Controller"; +// export { default as Model } from "./src/Model"; +// export { default as Molecule } from "./src/Molecule"; +// export { default as store } from "./src/store"; +export default () => { + console.log("strawberry"); +}; diff --git a/package-lock.json b/package-lock.json index 89ef3d1..124b121 100644 --- a/package-lock.json +++ b/package-lock.json @@ -234,6 +234,14 @@ "integrity": "sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==", "dev": true }, + "typescript-transpile-only": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/typescript-transpile-only/-/typescript-transpile-only-0.0.4.tgz", + "integrity": "sha512-iRNrUzeUZPra6lwEiHwobrKS77Lc3W6/dlngW2G4FA1SWuSyrc1LiZtsHcS4JQO7L/3oiiMbouXr1UPZtWroag==", + "requires": { + "tslib": "^1.9.3" + } + }, "whatwg-fetch": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", diff --git a/package.json b/package.json index 93d8a22..03bfcce 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "dev": "tsc --watch", + "dev": "tsc-watch --noClear -p ./tsconfig.json --onSuccess \"node ./dist/server.js\"", "build": "tsc", "test": "echo \"Error: no test specified\" && exit 1" }, @@ -27,10 +27,14 @@ "dependencies": { "@apollo/client": "^3.3.20", "@types/graphql": "^14.5.0", + "@types/isomorphic-fetch": "^0.0.35", "@types/lodash": "^4.14.170", "@types/react": "^17.0.11", "isomorphic-fetch": "^3.0.0", - "jquery": "^3.6.0" + "jquery": "^3.6.0", + "lodash": "^4.17.21", + "tsc-watch": "^4.4.0", + "typescript-transpile-only": "^0.0.4" }, "devDependencies": { "react": "^17.0.2", diff --git a/src/ApolloController.ts b/src/ApolloController.ts index 035fedc..ffc9b91 100644 --- a/src/ApolloController.ts +++ b/src/ApolloController.ts @@ -1,11 +1,17 @@ -import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client'; -import Controller from './Controller'; -import store from './store'; +import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client"; +import Controller from "./Controller"; +import store from "./store"; let diamondhandsClients = {}; -const setDiamondhandsClients = (obj) => { - diamondhandsClients = obj +const setDiamondhandsClients = (obj: { client: string }) => { + diamondhandsClients = obj; +}; + +interface GqlAttr { + client: String; + action: String; + variables: any; //chane to type } class ApolloController extends Controller { @@ -20,22 +26,22 @@ class ApolloController extends Controller { returnPartialData: false, }; - public gqlAttribute = ({ client, action, variables }) => { - if ( !this.controllerActionValid(action) ) return; + public gqlAttribute = ({ client, action, variables }: GqlAttr) => { + if (!this.controllerActionValid(action)) return; console.log("dev", "🎛 Controller#gqlAttribute", `🪡 ${action}`); const queryOptions = this.queryOptions(action, variables); const promise = new Promise((resolve, reject) => { // GraphQL fetch - return diamondhandsClients[client].query(queryOptions) - .then( res => this.handleApolloSuccess(res, resolve) ) - .catch( res => this.handleApolloError(res, reject) ); + return diamondhandsClients(client) + .query(queryOptions) + .then((res) => this.handleApolloSuccess(res, resolve)) + .catch((res) => this.handleApolloError(res, reject)); }); - return promise; - } + }; // private @@ -45,16 +51,16 @@ class ApolloController extends Controller { } console.error("⛔️ Error:", e); reject(e); - } + }; private handleApolloSuccess = (res, resolve) => { console.log("dev", "✅ Success:", res); resolve(res.data); - this._finishStack.forEach( (f) => { + this._finishStack.forEach((f) => { f(res.data); }); - } + }; private queryOptions(action, variables) { if (variables) console.log("dev", "🔮 Query variables:", variables); @@ -63,10 +69,10 @@ class ApolloController extends Controller { ...this.baseQueryOptions, query: this.requestBody(action), variables: variables, - operationName: action - } + operationName: action, + }; } } -export default ApolloController -export { setDiamondhandsClients as setDiamondhandsClients } +export default ApolloController; +export { setDiamondhandsClients as setDiamondhandsClients }; diff --git a/src/Controller.ts b/src/Controller.ts index 976bf6d..c92fe09 100644 --- a/src/Controller.ts +++ b/src/Controller.ts @@ -1,39 +1,35 @@ import fetch from "isomorphic-fetch"; import store from "./store"; -import $ from "jquery"; +// import $ from "jquery"; class Controller { _finishStack = []; public getAttribute(action) { - if ( !this.controllerActionValid(action) ) return; + if (!this.controllerActionValid(action)) return; console.log("debug", "🎛 Controller#getAttribute", `🪡 ${action}`); // return this.controllerFetch( ...this.requestBody(action) ); - console.warn("Not implimented yet") + console.warn("Not implimented yet"); } // Plain text fetch public basicFetch(path, body) { - return fetch(path, this.basicFetchOptions(body)) - .then(res => res.text()) + return fetch(path, this.basicFetchOptions(body)).then((res) => res.text()); } // Rest fetch public controllerFetch(method, path, body) { - return fetch( - `${this.server()}${path}`, - this.fetchOptions(method, body) - ) - .then(res => res.json()) - .then(this.success) // https://github.com/github/fetch/issues/223#issuecomment-148927226 - .catch(this.fail) - .then(this.always, this.always); + return fetch(`${this.server()}${path}`, this.fetchOptions(method, body)) + .then((res) => res.json()) + .then(this.success) // https://github.com/github/fetch/issues/223#issuecomment-148927226 + .catch(this.fail) + .then(this.always, this.always); } public onFinishedFetching(f) { this._finishStack.push(f); - return 'ok'; + return "ok"; } protected requestBody = (action) => { @@ -45,20 +41,22 @@ class Controller { console.error("🍽 Empty request body:", body, this); } return body; - } + }; // protected protected controllerActionValid(action) { if (action === "" || action === undefined || action === null) { - return console.error("🛂 Please pass in an attribute resolver defined on a model, such as user.ts `firstName`.") + return console.error( + "🛂 Please pass in an attribute resolver defined on a model, such as user.ts `firstName`." + ); } else { return true; } } // private - + private server() { const baseUrl = store.get("serverProps.env.server_url"); console.log("dev", `🎩 Server: ${baseUrl}`); @@ -69,49 +67,49 @@ class Controller { private success = (res) => { console.log("debug", "✅ Success:", res); - this._finishStack.forEach( (f) => { + this._finishStack.forEach((f) => { f(res.data); }); this._finishStack = []; return res; - } + }; private fail = (res) => { console.log("dev", "❌ Fail:", res); console.log("dev", "🏗 Check your server & your ngrok tunnel."); return res; - } + }; private always = (res) => { console.log("debug", "👾 Always:", res); return res; - } + }; private fetchOptions(method, body) { return { method: method, - mode: 'cors', - cache: 'no-cache', - headers: { - 'Content-Type': 'application/json; charset=UTF-8', - 'Accept': 'application/json', + mode: "cors", + cache: "no-cache", + headers: { + "Content-Type": "application/json; charset=UTF-8", + Accept: "application/json", }, body: JSON.stringify(body), - credentials: 'include' + credentials: "include", }; } private basicFetchOptions(body) { return { - method: 'GET', - mode: 'cors', - cache: 'no-cache', - headers: { - 'Content-Type': 'text/plain', + method: "GET", + mode: "cors", + cache: "no-cache", + headers: { + "Content-Type": "text/plain", }, body: body, - credentials: 'include' + credentials: "include", }; } } diff --git a/src/Model.ts b/src/Model.ts index 48c4360..0c6f44d 100644 --- a/src/Model.ts +++ b/src/Model.ts @@ -1,6 +1,6 @@ // Validation logic -import resolver from "./resolver" +import resolver from "./resolver"; class Model { constructor(id) { @@ -22,7 +22,7 @@ class Model { // private - private generateResolver = ({ endpoint, attr, Value, Edit }) => { + private generateResolver({ endpoint, attr, Value, Edit }) { console.log("dev", "👀 Resolver for:", [this.name].concat(arguments)); this[attr] = resolver({ @@ -30,10 +30,9 @@ class Model { model: this, attr: attr, Value: Value, - Edit: Edit + Edit: Edit, }); } } export default Model; - diff --git a/src/Muon.ts b/src/Muon.ts index d97aff4..9d5dcf5 100644 --- a/src/Muon.ts +++ b/src/Muon.ts @@ -1,5 +1,6 @@ import * as React from "react"; import store from "./store"; +import * as _ from "lodash"; // Store <-> client state class Muon extends React.Component { diff --git a/src/Proton.ts b/src/Proton.ts index 8d8fa90..55ac78d 100644 --- a/src/Proton.ts +++ b/src/Proton.ts @@ -1,5 +1,6 @@ import store from "./store"; import Muan from "./Muon"; +import * as _ from "lodash"; // Server <-> client state const _finishedRequests = []; @@ -9,11 +10,11 @@ class Proton extends Muan { if (this.attr) { store.getFromServer(this.model, this.attr).then(this.finishedReq); } - } + }; protected onBlur = () => { // TODO: Save - } + }; protected isFinishedReq() { return _.includes(_finishedRequests, this); @@ -21,7 +22,7 @@ class Proton extends Muan { protected finishedReq = () => { _finishedRequests.push(this); - } + }; protected componentDidMount() { this.mounted = true; diff --git a/src/store.ts b/src/store.ts index 6d7a00a..bbd6883 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,3 +1,5 @@ +import _ from "lodash"; + class Store { private state; private requestTracker = {}; diff --git a/tsconfig.json b/tsconfig.json index 0e13f93..614a0c9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,73 @@ { "compilerOptions": { - "target": "es5", - "module": "commonjs", - "declaration": true, - "outDir": "./dist", - "strict": true, - "esModuleInterop": true + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + // "lib": [], /* Specify library files to be included in the compilation. */ + "allowJs": true /* Allow javascript files to be compiled. */, + "checkJs": false /* Report errors in .js files. */, + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ + "declaration": true /* Generates corresponding '.d.ts' file. */, + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist" /* Redirect output structure to the directory. */, + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": false /* Enable all strict type-checking options. */, + "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */, + "strictNullChecks": false /* Enable strict null checks. */, + "strictFunctionTypes": false /* Enable strict checking of function types. */, + "strictBindCallApply": false /* Enable strict 'bind', 'call', and 'apply' methods on functions. */, + "strictPropertyInitialization": false /* Enable strict checking of property initialization in classes. */, + "noImplicitThis": false /* Raise error on 'this' expressions with an implied 'any' type. */, + "alwaysStrict": false /* Parse in strict mode and emit "use strict" for each source file. */, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, + "noUnusedParameters": false /* Report errors on unused parameters. */, + "noImplicitReturns": false /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": false /* Report errors for fallthrough cases in switch statement. */, + "noUncheckedIndexedAccess": false /* Include 'undefined' in index signature results */, + "noImplicitOverride": false /* Ensure overriding members in derived classes are marked with an 'override' modifier. */, + "noPropertyAccessFromIndexSignature": false /* Require undeclared properties from index signatures to use element accesses. */, + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + "skipLibCheck": true /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, "include": ["src", "index.ts"], "exclude": ["node_modules", "**/__tests__/*"] From 1dc1942896204bd01a732b14912793110b71892f Mon Sep 17 00:00:00 2001 From: Desmond Sadler Date: Sun, 27 Jun 2021 03:59:45 +0600 Subject: [PATCH 04/15] Removed Errors --- dist/index.d.ts | 2 - dist/index.js | 11 - dist/src/ApolloController.d.ts | 19 -- dist/src/ApolloController.js | 58 ------ dist/src/Atom.d.ts | 5 - dist/src/Atom.js | 18 -- dist/src/Controller.d.ts | 16 -- dist/src/Controller.js | 104 ---------- dist/src/Model.d.ts | 7 - dist/src/Model.js | 34 --- dist/src/Molecule.d.ts | 5 - dist/src/Molecule.js | 12 -- dist/src/Muon.d.ts | 18 -- dist/src/Muon.js | 95 --------- dist/src/Proton.d.ts | 9 - dist/src/Proton.js | 53 ----- dist/src/resolver.d.ts | 12 -- dist/src/resolver.js | 40 ---- dist/src/store.d.ts | 20 -- dist/src/store.js | 132 ------------ src/ApolloController.ts | 1 + src/Controller.ts | 1 + src/Model.ts | 1 + src/Muon.ts | 1 + src/Proton.ts | 1 + src/resolver.ts | 2 + src/store.ts | 1 + yarn.lock | 364 +++++++++++++++++++++++++++++++++ 28 files changed, 372 insertions(+), 670 deletions(-) delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/src/ApolloController.d.ts delete mode 100644 dist/src/ApolloController.js delete mode 100644 dist/src/Atom.d.ts delete mode 100644 dist/src/Atom.js delete mode 100644 dist/src/Controller.d.ts delete mode 100644 dist/src/Controller.js delete mode 100644 dist/src/Model.d.ts delete mode 100644 dist/src/Model.js delete mode 100644 dist/src/Molecule.d.ts delete mode 100644 dist/src/Molecule.js delete mode 100644 dist/src/Muon.d.ts delete mode 100644 dist/src/Muon.js delete mode 100644 dist/src/Proton.d.ts delete mode 100644 dist/src/Proton.js delete mode 100644 dist/src/resolver.d.ts delete mode 100644 dist/src/resolver.js delete mode 100644 dist/src/store.d.ts delete mode 100644 dist/src/store.js create mode 100644 yarn.lock diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 4cab553..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: () => void; -export default _default; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 93ddb6a..0000000 --- a/dist/index.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// export { default as ApolloController } from "./src/ApolloController"; -// export { default as Atom } from "./src/Atom"; -// export { default as Controller } from "./src/Controller"; -// export { default as Model } from "./src/Model"; -// export { default as Molecule } from "./src/Molecule"; -// export { default as store } from "./src/store"; -exports.default = () => { - console.log("strawberry"); -}; diff --git a/dist/src/ApolloController.d.ts b/dist/src/ApolloController.d.ts deleted file mode 100644 index 1577e93..0000000 --- a/dist/src/ApolloController.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Controller from "./Controller"; -declare const setDiamondhandsClients: (obj: { - client: string; -}) => void; -interface GqlAttr { - client: String; - action: String; - variables: any; -} -declare class ApolloController extends Controller { - constructor(); - private baseQueryOptions; - gqlAttribute: ({ client, action, variables }: GqlAttr) => Promise; - private handleApolloError; - private handleApolloSuccess; - private queryOptions; -} -export default ApolloController; -export { setDiamondhandsClients as setDiamondhandsClients }; diff --git a/dist/src/ApolloController.js b/dist/src/ApolloController.js deleted file mode 100644 index 15c69d5..0000000 --- a/dist/src/ApolloController.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setDiamondhandsClients = void 0; -const Controller_1 = __importDefault(require("./Controller")); -let diamondhandsClients = {}; -const setDiamondhandsClients = (obj) => { - diamondhandsClients = obj; -}; -exports.setDiamondhandsClients = setDiamondhandsClients; -class ApolloController extends Controller_1.default { - constructor() { - super(); - this.baseQueryOptions = { - errorPolicy: "none", - fetchPolicy: "cache-first", - notifyOnNetworkStatusChange: true, - returnPartialData: false, - }; - this.gqlAttribute = ({ client, action, variables }) => { - if (!this.controllerActionValid(action)) - return; - console.log("dev", "🎛 Controller#gqlAttribute", `🪡 ${action}`); - const queryOptions = this.queryOptions(action, variables); - const promise = new Promise((resolve, reject) => { - // GraphQL fetch - return diamondhandsClients(client) - .query(queryOptions) - .then((res) => this.handleApolloSuccess(res, resolve)) - .catch((res) => this.handleApolloError(res, reject)); - }); - return promise; - }; - // private - this.handleApolloError = (e, reject) => { - if (e.message.match("authentication")) { - alert("🪵 Please log in to your server."); - } - console.error("⛔️ Error:", e); - reject(e); - }; - this.handleApolloSuccess = (res, resolve) => { - console.log("dev", "✅ Success:", res); - resolve(res.data); - this._finishStack.forEach((f) => { - f(res.data); - }); - }; - } - queryOptions(action, variables) { - if (variables) - console.log("dev", "🔮 Query variables:", variables); - return Object.assign(Object.assign({}, this.baseQueryOptions), { query: this.requestBody(action), variables: variables, operationName: action }); - } -} -exports.default = ApolloController; diff --git a/dist/src/Atom.d.ts b/dist/src/Atom.d.ts deleted file mode 100644 index 7f35091..0000000 --- a/dist/src/Atom.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import Proton from "./Proton"; -declare class Atom extends Proton { - constructor(props: any); -} -export default Atom; diff --git a/dist/src/Atom.js b/dist/src/Atom.js deleted file mode 100644 index badba49..0000000 --- a/dist/src/Atom.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const Proton_1 = __importDefault(require("./Proton")); -class Atom extends Proton_1.default { - constructor(props) { - super(props); - if (props.molecule) - return; - if (Object.keys(this.state).length !== 1) { - console.error("↳ ⚛ Atoms can only have once piece of state. ⚛"); - console.log("dev", this); - } - } -} -exports.default = Atom; diff --git a/dist/src/Controller.d.ts b/dist/src/Controller.d.ts deleted file mode 100644 index bcf07c7..0000000 --- a/dist/src/Controller.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare class Controller { - _finishStack: any[]; - getAttribute(action: any): void; - basicFetch(path: any, body: any): Promise; - controllerFetch(method: any, path: any, body: any): Promise; - onFinishedFetching(f: any): string; - protected requestBody: (action: any) => any; - protected controllerActionValid(action: any): true | void; - private server; - private success; - private fail; - private always; - private fetchOptions; - private basicFetchOptions; -} -export default Controller; diff --git a/dist/src/Controller.js b/dist/src/Controller.js deleted file mode 100644 index 5f2a33a..0000000 --- a/dist/src/Controller.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const isomorphic_fetch_1 = __importDefault(require("isomorphic-fetch")); -const store_1 = __importDefault(require("./store")); -// import $ from "jquery"; -class Controller { - constructor() { - this._finishStack = []; - this.requestBody = (action) => { - const body = this[action](); - if (body) { - console.log("dev", "🌮 Request body:", body, this); - } - else { - console.error("🍽 Empty request body:", body, this); - } - return body; - }; - this.success = (res) => { - console.log("debug", "✅ Success:", res); - this._finishStack.forEach((f) => { - f(res.data); - }); - this._finishStack = []; - return res; - }; - this.fail = (res) => { - console.log("dev", "❌ Fail:", res); - console.log("dev", "🏗 Check your server & your ngrok tunnel."); - return res; - }; - this.always = (res) => { - console.log("debug", "👾 Always:", res); - return res; - }; - } - getAttribute(action) { - if (!this.controllerActionValid(action)) - return; - console.log("debug", "🎛 Controller#getAttribute", `🪡 ${action}`); - // return this.controllerFetch( ...this.requestBody(action) ); - console.warn("Not implimented yet"); - } - // Plain text fetch - basicFetch(path, body) { - return isomorphic_fetch_1.default(path, this.basicFetchOptions(body)).then((res) => res.text()); - } - // Rest fetch - controllerFetch(method, path, body) { - return isomorphic_fetch_1.default(`${this.server()}${path}`, this.fetchOptions(method, body)) - .then((res) => res.json()) - .then(this.success) // https://github.com/github/fetch/issues/223#issuecomment-148927226 - .catch(this.fail) - .then(this.always, this.always); - } - onFinishedFetching(f) { - this._finishStack.push(f); - return "ok"; - } - // protected - controllerActionValid(action) { - if (action === "" || action === undefined || action === null) { - return console.error("🛂 Please pass in an attribute resolver defined on a model, such as user.ts `firstName`."); - } - else { - return true; - } - } - // private - server() { - const baseUrl = store_1.default.get("serverProps.env.server_url"); - console.log("dev", `🎩 Server: ${baseUrl}`); - return baseUrl; - } - fetchOptions(method, body) { - return { - method: method, - mode: "cors", - cache: "no-cache", - headers: { - "Content-Type": "application/json; charset=UTF-8", - Accept: "application/json", - }, - body: JSON.stringify(body), - credentials: "include", - }; - } - basicFetchOptions(body) { - return { - method: "GET", - mode: "cors", - cache: "no-cache", - headers: { - "Content-Type": "text/plain", - }, - body: body, - credentials: "include", - }; - } -} -exports.default = Controller; diff --git a/dist/src/Model.d.ts b/dist/src/Model.d.ts deleted file mode 100644 index 401b13d..0000000 --- a/dist/src/Model.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare class Model { - constructor(id: any); - hydrate(obj: any): this; - protected getKey(attr: any): string; - private generateResolver; -} -export default Model; diff --git a/dist/src/Model.js b/dist/src/Model.js deleted file mode 100644 index 7a30120..0000000 --- a/dist/src/Model.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -// Validation logic -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const resolver_1 = __importDefault(require("./resolver")); -class Model { - constructor(id) { - this.id = id; - this.data = {}; - this.name = this.name(); - this.resolvers().forEach(this.generateResolver); - } - hydrate(obj) { - this.data = obj; - return this; - } - getKey(attr) { - return `${this.name}.${attr}`; - } - // private - generateResolver({ endpoint, attr, Value, Edit }) { - console.log("dev", "👀 Resolver for:", [this.name].concat(arguments)); - this[attr] = resolver_1.default({ - endpoint: endpoint, - model: this, - attr: attr, - Value: Value, - Edit: Edit, - }); - } -} -exports.default = Model; diff --git a/dist/src/Molecule.d.ts b/dist/src/Molecule.d.ts deleted file mode 100644 index 0396673..0000000 --- a/dist/src/Molecule.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import Atom from "./Atom"; -declare class Molecule extends Atom { - constructor(props: any); -} -export default Molecule; diff --git a/dist/src/Molecule.js b/dist/src/Molecule.js deleted file mode 100644 index 945fab1..0000000 --- a/dist/src/Molecule.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const Atom_1 = __importDefault(require("./Atom")); -class Molecule extends Atom_1.default { - constructor(props) { - super(Object.assign(Object.assign({}, props), { molecule: true })); - } -} -exports.default = Molecule; diff --git a/dist/src/Muon.d.ts b/dist/src/Muon.d.ts deleted file mode 100644 index 73e01d1..0000000 --- a/dist/src/Muon.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as React from "react"; -declare class Muon extends React.Component { - model: any; - attr: any; - storeKey: any; - endpoint: any; - reactSetState: any; - constructor(props: any); - protected quark(): any; - protected componentDidMount(): void; - protected componentWillUnmount(): void; - protected onChange: (e: any) => void; - protected isFetching(): boolean; - private diamondHandsSetState; - private refresh; - private storeValue; -} -export default Muon; diff --git a/dist/src/Muon.js b/dist/src/Muon.js deleted file mode 100644 index c0a1f6b..0000000 --- a/dist/src/Muon.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const React = __importStar(require("react")); -const store_1 = __importDefault(require("./store")); -// Store <-> client state -class Muon extends React.Component { - constructor(props) { - super(props); - this.onChange = (e) => { - let newStoreState = {}; - const newKeyValue = e.target.value; - newStoreState[`${this.storeKey}`] = newKeyValue; - store_1.default.set(newStoreState); - this.setState({ value: newKeyValue }); - }; - this.refresh = () => { - if (!this.mounted) - return; - console.log("debug", "🌊 Muon refresh:", this.quark()); - this.forceUpdate(); - }; - this.storeValue = () => { - const value = store_1.default.get(this.storeKey); - if (this.attr) { - console.log("debug", `🧬 Quark attr:`, this.attr); - if (value) { - console.log("debug", `🧩`, `Quark value: ${value}`); - } - else { - if (this.isFetching()) - console.log("dev", `🧩`, "Fetching..."); - } - } - return value || ""; - }; - this.model = props.model; - this.attr = props.attr; - this.storeKey = props.storeKey || this.model.getKey(this.attr); - this.endpoint = props.endpoint; - store_1.default.onUpdate(this.refresh); - this.reactSetState = this.setState; - this.setState = () => this.diamondHandsSetState.apply(this, arguments); - this.state = { - value: "", - }; - } - quark() { - // return if quark is already set - if (this.state.value.length) - return this.state.value; - if (!this.storeKey) { - console.log("dev", `🗝 You need a store key in your component to get a value.`); - console.log("dev", `↳`, this); - } - return this.storeValue(); - } - componentDidMount() { - this.mounted = true; - } - componentWillUnmount() { - this.mounted = false; - } - isFetching() { - return this.proton && !this.isFinishedReq(); - } - // private - diamondHandsSetState(state) { - if (!this.mounted) - return; - this.reactSetState(state); - } -} -exports.default = Muon; diff --git a/dist/src/Proton.d.ts b/dist/src/Proton.d.ts deleted file mode 100644 index e806923..0000000 --- a/dist/src/Proton.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import Muan from "./Muon"; -declare class Proton extends Muan { - protected accelerate: () => void; - protected onBlur: () => void; - protected isFinishedReq(): boolean; - protected finishedReq: () => void; - protected componentDidMount(): void; -} -export default Proton; diff --git a/dist/src/Proton.js b/dist/src/Proton.js deleted file mode 100644 index 29a26ce..0000000 --- a/dist/src/Proton.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const store_1 = __importDefault(require("./store")); -const Muon_1 = __importDefault(require("./Muon")); -const _ = __importStar(require("lodash")); -// Server <-> client state -const _finishedRequests = []; -class Proton extends Muon_1.default { - constructor() { - super(...arguments); - this.accelerate = () => { - if (this.attr) { - store_1.default.getFromServer(this.model, this.attr).then(this.finishedReq); - } - }; - this.onBlur = () => { - // TODO: Save - }; - this.finishedReq = () => { - _finishedRequests.push(this); - }; - } - isFinishedReq() { - return _.includes(_finishedRequests, this); - } - componentDidMount() { - this.mounted = true; - this.accelerate(); - } -} -exports.default = Proton; diff --git a/dist/src/resolver.d.ts b/dist/src/resolver.d.ts deleted file mode 100644 index 971064c..0000000 --- a/dist/src/resolver.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Proton from "./Proton"; -declare class Resolver extends Proton { - value(): void; - edit(): void; - query(variables: any): any; -} -declare const resolver: ({ endpoint, model, attr }: { - endpoint: any; - model: any; - attr: any; -}) => Resolver; -export default resolver; diff --git a/dist/src/resolver.js b/dist/src/resolver.js deleted file mode 100644 index 263d185..0000000 --- a/dist/src/resolver.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// import * as React from "react"; -const Proton_1 = __importDefault(require("./Proton")); -// import View from './components/View' -let value = null; -class Resolver extends Proton_1.default { - value() { - const Value = this.props.Value; - // return ( - // - // ) - } - edit() { - const Edit = this.props.Edit; - // return ( - // // - // ) - } - query(variables) { - return this.model.controller.gqlAttribute({ - client: this.model.controller.client(), - action: this.props.attr, - variables: variables, - }); - } -} -// const resolver = ({ endpoint, model, attr, Value, Edit }) => { -const resolver = ({ endpoint, model, attr }) => { - return new Resolver({ - model: model, - attr: attr, - // Value: Value, - // Edit: Edit, - }); -}; -exports.default = resolver; diff --git a/dist/src/store.d.ts b/dist/src/store.d.ts deleted file mode 100644 index 94990aa..0000000 --- a/dist/src/store.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -declare class Store { - private state; - private requestTracker; - private onUpdateStack; - private waitingForKeys; - constructor(initialState: any); - set(newState: any): void; - get(passKey: any): any; - getFromServer(model: any, attr: any): any; - waitFor(passKey: any, f: any): any; - onUpdate: (f: any) => string; - private checkWaitFor; - private isGraphql; - private cacheKey; - private handleServerResponse; - private valid; - private debug; -} -declare const store: Store; -export default store; diff --git a/dist/src/store.js b/dist/src/store.js deleted file mode 100644 index 74b9846..0000000 --- a/dist/src/store.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// @ts-ignore -const lodash_1 = __importDefault(require("lodash")); -class Store { - constructor(initialState) { - this.requestTracker = {}; - this.onUpdateStack = []; - this.waitingForKeys = {}; - this.onUpdate = (f) => { - console.log("all", "🥞 Store#onUpdate:", f); - this.onUpdateStack.push(f); - return "ok"; - }; - this.handleServerResponse = (attr, model, res) => { - console.log("dev", "📜 Response:", res); - let newStateObj = {}; - // Save new state to store - const relevantData = lodash_1.default(res).get(model.controller.accessor()); - if (relevantData.results) { - newStateObj[model.name] = newStateObj[model.name] || {}; - newStateObj[model.name][attr] = relevantData.results; - } - else { - newStateObj[model.name] = relevantData; - } - this.set(newStateObj); - }; - this.debug = () => { - if (this.state) - console.log("dev", "🍱", this.state); - return this.state; - }; - this.state = initialState; - console.log("debug", "🗺 Store ctx:", this); - window.bug = this.debug; - } - set(newState) { - console.log("debug", "🚮 Old state:", this.state); - console.log("debug", "💽 New state:", newState); - // Object.assign not recommended for deep merge - this.state = lodash_1.default.merge(this.state, newState); - window.setTimeout(() => { - console.log("dev", "🍱 Store state:", this.state); - this.checkWaitFor(); - this.onUpdateStack.forEach((f) => { - console.log("all", "🥞 Store onUpdateStack:", f); - f(this.state); - }); - }, 0); - } - get(passKey) { - console.log("debug", "💅 Store#get:", passKey); - if (!passKey || passKey === "") { - console.error("🙈 Invalid store request: ", arguments); - } - return this.cacheKey(passKey); - } - getFromServer(model, attr) { - // Already requested it - if (this.requestTracker[attr]) - return this.requestTracker[attr]; - if (!attr || !model) { - console.error("🙈 Invalid store request: ", attr, model); - } - model.controller.onFinishedFetching((res) => { - this.handleServerResponse(attr, model, res); - }); - console.log("dev", "🌀 Starting get from server...", model.name, attr); - if (this.isGraphql(model, attr)) { - this.requestTracker[attr] = model.controller.gqlAttribute({ - client: model.controller.client(), - action: attr, - }); - } - else { - this.requestTracker[attr] = model.controller.getAttribute(attr); - } - return this.requestTracker[attr]; - } - waitFor(passKey, f) { - const value = this.get(passKey); - if (this.valid(value)) { - return f(value); - } - if (lodash_1.default.includes(this.waitingForKeys[passKey], f)) { - return; - } - if (this.waitingForKeys[passKey]) { - this.waitingForKeys[passKey].push(f); - } - else { - this.waitingForKeys[passKey] = [f]; - } - } - // private - checkWaitFor() { - console.log("debug", "🧳 Check wait for:", Object.keys(this.waitingForKeys)); - Object.keys(this.waitingForKeys).forEach((passKey) => { - const value = this.get(passKey); - console.log("debug", "🧳 Value:", value); - if (this.valid(value)) { - this.waitingForKeys[passKey].forEach((f) => { - console.log("debug", "🧳 Wait for callback called:", f); - f(value); - }); - console.log("debug", "🧳 Destroyed:", this.waitingForKeys[passKey]); - delete this.waitingForKeys[passKey]; - } - }); - } - isGraphql(model, attr) { - return model.controller.requestBody(attr).kind === "Document"; - } - cacheKey(passKey) { - const cachedValue = lodash_1.default.get(this.state, passKey); - if (this.valid(cachedValue)) { - console.log("debug", "💰 Cached value:", cachedValue); - return cachedValue; - } - } - valid(x) { - console.log("debug", "🦆 Store#valid type:", typeof x); - return !lodash_1.default.isNil(x) && !lodash_1.default.isNaN(x); - } -} -const initialState = {}; -const store = new Store(initialState); -exports.default = store; diff --git a/src/ApolloController.ts b/src/ApolloController.ts index ffc9b91..296f83c 100644 --- a/src/ApolloController.ts +++ b/src/ApolloController.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client"; import Controller from "./Controller"; import store from "./store"; diff --git a/src/Controller.ts b/src/Controller.ts index c92fe09..8dc00d0 100644 --- a/src/Controller.ts +++ b/src/Controller.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import fetch from "isomorphic-fetch"; import store from "./store"; // import $ from "jquery"; diff --git a/src/Model.ts b/src/Model.ts index 0c6f44d..c131872 100644 --- a/src/Model.ts +++ b/src/Model.ts @@ -1,3 +1,4 @@ +// @ts-nocheck // Validation logic import resolver from "./resolver"; diff --git a/src/Muon.ts b/src/Muon.ts index 9d5dcf5..aca245e 100644 --- a/src/Muon.ts +++ b/src/Muon.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import * as React from "react"; import store from "./store"; import * as _ from "lodash"; diff --git a/src/Proton.ts b/src/Proton.ts index 55ac78d..91ae323 100644 --- a/src/Proton.ts +++ b/src/Proton.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import store from "./store"; import Muan from "./Muon"; import * as _ from "lodash"; diff --git a/src/resolver.ts b/src/resolver.ts index d57cdcb..64eb97d 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -1,3 +1,5 @@ +// @ts-nocheck + // import * as React from "react"; import Proton from "./Proton"; import store from "./store"; diff --git a/src/store.ts b/src/store.ts index bbd6883..a6cd23e 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import _ from "lodash"; class Store { diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..ae0723a --- /dev/null +++ b/yarn.lock @@ -0,0 +1,364 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@apollo/client@^3.3.20": + version "3.3.20" + resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.3.20.tgz#8f0935fa991857e9cf2e73c9bd378ad7ec97caf8" + integrity sha512-hS7UmBwJweudw/J3M0RAcusMHNiRuGqkRH6g91PM2ev8cXScIMdXr/++9jo7wD1nAITMCMF4HQQ3LFaw/Or0Bw== + dependencies: + "@graphql-typed-document-node/core" "^3.0.0" + "@types/zen-observable" "^0.8.0" + "@wry/context" "^0.6.0" + "@wry/equality" "^0.5.0" + fast-json-stable-stringify "^2.0.0" + graphql-tag "^2.12.0" + hoist-non-react-statics "^3.3.2" + optimism "^0.16.0" + prop-types "^15.7.2" + symbol-observable "^4.0.0" + ts-invariant "^0.7.0" + tslib "^1.10.0" + zen-observable "^0.8.14" + +"@graphql-typed-document-node/core@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950" + integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg== + +"@types/graphql@^14.5.0": + version "14.5.0" + resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-14.5.0.tgz#a545fb3bc8013a3547cf2f07f5e13a33642b75d6" + integrity sha512-MOkzsEp1Jk5bXuAsHsUi6BVv0zCO+7/2PTiZMXWDSsMXvNU6w/PLMQT2vHn8hy2i0JqojPz1Sz6rsFjHtsU0lA== + dependencies: + graphql "*" + +"@types/isomorphic-fetch@^0.0.35": + version "0.0.35" + resolved "https://registry.yarnpkg.com/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.35.tgz#c1c0d402daac324582b6186b91f8905340ea3361" + integrity sha512-DaZNUvLDCAnCTjgwxgiL1eQdxIKEpNLOlTNtAgnZc50bG2copGhRrFN9/PxPBuJe+tZVLCbQ7ls0xveXVRPkvw== + +"@types/lodash@^4.14.170": + version "4.14.170" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.170.tgz#0d67711d4bf7f4ca5147e9091b847479b87925d6" + integrity sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q== + +"@types/prop-types@*": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + +"@types/react@^17.0.11": + version "17.0.11" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.11.tgz#67fcd0ddbf5a0b083a0f94e926c7d63f3b836451" + integrity sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" + integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== + +"@types/zen-observable@^0.8.0": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" + integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== + +"@wry/context@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.6.0.tgz#f903eceb89d238ef7e8168ed30f4511f92d83e06" + integrity sha512-sAgendOXR8dM7stJw3FusRxFHF/ZinU0lffsA2YTyyIOfic86JX02qlPqPVqJNZJPAxFt+2EE8bvq6ZlS0Kf+Q== + dependencies: + tslib "^2.1.0" + +"@wry/equality@^0.5.0": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.1.tgz#b22e4e1674d7bf1439f8ccdccfd6a785f6de68b0" + integrity sha512-FZKbdpbcVcbDxQrKcaBClNsQaMg9nof1RKM7mReJe5DKUzM5u8S7T+PqwNqvib5O2j2xxF1R4p5O3+b6baTrbw== + dependencies: + tslib "^2.1.0" + +"@wry/trie@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.3.0.tgz#3245e74988c4e3033299e479a1bf004430752463" + integrity sha512-Yw1akIogPhAT6XPYsRHlZZIS0tIGmAl9EYXHi2scf7LPKKqdqmow/Hu4kEqP2cJR3EjaU/9L0ZlAjFf3hFxmug== + dependencies: + tslib "^2.1.0" + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +csstype@^3.0.2: + version "3.0.8" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" + integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== + +duplexer@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== + +event-stream@=3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + integrity sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE= + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= + +graphql-tag@^2.12.0: + version "2.12.5" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.5.tgz#5cff974a67b417747d05c8d9f5f3cb4495d0db8f" + integrity sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ== + dependencies: + tslib "^2.1.0" + +graphql@*: + version "15.5.1" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" + integrity sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw== + +hoist-non-react-statics@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isomorphic-fetch@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" + integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== + dependencies: + node-fetch "^2.6.1" + whatwg-fetch "^3.4.1" + +jquery@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" + integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= + +node-cleanup@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-cleanup/-/node-cleanup-2.1.2.tgz#7ac19abd297e09a7f72a71545d951b517e4dde2c" + integrity sha1-esGavSl+Caf3KnFUXZUbUX5N3iw= + +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +optimism@^0.16.0: + version "0.16.1" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.1.tgz#7c8efc1f3179f18307b887e18c15c5b7133f6e7d" + integrity sha512-64i+Uw3otrndfq5kaoGNoY7pvOhSsjFEN4bdEFh80MWVk/dbgJfMv7VFDeCT8LxNAlEVhQmdVEbfE7X2nWNIIg== + dependencies: + "@wry/context" "^0.6.0" + "@wry/trie" "^0.3.0" + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + integrity sha1-/lo0sMvOErWqaitAPuLnO2AvFEU= + dependencies: + through "~2.3" + +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +ps-tree@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" + integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== + dependencies: + event-stream "=3.3.4" + +react-is@^16.7.0, react-is@^16.8.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + integrity sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8= + dependencies: + through "2" + +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + integrity sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ= + dependencies: + duplexer "~0.1.1" + +string-argv@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.1.2.tgz#c5b7bc03fb2b11983ba3a72333dd0559e77e4738" + integrity sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA== + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +symbol-observable@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205" + integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ== + +through@2, through@~2.3, through@~2.3.1: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +ts-invariant@^0.7.0: + version "0.7.5" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.7.5.tgz#f9658719f9a7737b117d09820d952aacf6263f9c" + integrity sha512-qfVyqTYWEqADMtncLqwpUdMjMSXnsqOeqGtj1LeJNFDjz8oqZ1YxLEp29YCOq65z0LgEiERqQ8ThVjnfibJNpg== + dependencies: + tslib "^2.1.0" + +tsc-watch@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/tsc-watch/-/tsc-watch-4.4.0.tgz#3ebbf1db54bcef6bfe534b330fa87284a4139320" + integrity sha512-+0Yey6ptOOXAnt44OKTk2/EnQnmA0auL7VWXm9d9abMS4tabt0Xdr9B4AK6OJbWAre9ZdLA81+Nk8sz9unptyA== + dependencies: + cross-spawn "^7.0.3" + node-cleanup "^2.1.2" + ps-tree "^1.2.0" + string-argv "^0.1.1" + strip-ansi "^6.0.0" + +tslib@^1.10.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" + integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== + +typescript-transpile-only@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/typescript-transpile-only/-/typescript-transpile-only-0.0.4.tgz#d52a9a5587d26272c29cb867b1ba4ab1323d77fb" + integrity sha512-iRNrUzeUZPra6lwEiHwobrKS77Lc3W6/dlngW2G4FA1SWuSyrc1LiZtsHcS4JQO7L/3oiiMbouXr1UPZtWroag== + dependencies: + tslib "^1.9.3" + +typescript@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" + integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== + +whatwg-fetch@^3.4.1: + version "3.6.2" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" + integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +zen-observable@^0.8.14: + version "0.8.15" + resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" + integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== From c30d4dac996a0bd447ebeb65192b756ee9567dd9 Mon Sep 17 00:00:00 2001 From: Mahabub Islam Date: Sun, 27 Jun 2021 04:07:34 +0600 Subject: [PATCH 05/15] Empty Commit to check Author and Sign From e4e080545d63c2352c6e8741ee8636a0ed627d0e Mon Sep 17 00:00:00 2001 From: Mahabub Islam Date: Sun, 27 Jun 2021 10:33:15 +0600 Subject: [PATCH 06/15] added the accessor --- src/Model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model.ts b/src/Model.ts index c131872..dcd4d7e 100644 --- a/src/Model.ts +++ b/src/Model.ts @@ -17,7 +17,7 @@ class Model { return this; } - protected getKey(attr) { + private getKey(attr) { return `${this.name}.${attr}`; } From 09c0a4e9b35b348c27c2d050f9d70b83fc9e9b84 Mon Sep 17 00:00:00 2001 From: torhex137 Date: Sun, 27 Jun 2021 00:18:08 -0600 Subject: [PATCH 07/15] no errors --- index.ts | 15 ++++++--------- src/Atom.ts | 2 +- src/Molecule.ts | 2 +- src/Muon.ts | 13 ++++--------- src/Proton.ts | 6 +++--- tsconfig.json | 2 +- 6 files changed, 16 insertions(+), 24 deletions(-) diff --git a/index.ts b/index.ts index c3de5a4..fdfb686 100644 --- a/index.ts +++ b/index.ts @@ -1,9 +1,6 @@ -// export { default as ApolloController } from "./src/ApolloController"; -// export { default as Atom } from "./src/Atom"; -// export { default as Controller } from "./src/Controller"; -// export { default as Model } from "./src/Model"; -// export { default as Molecule } from "./src/Molecule"; -// export { default as store } from "./src/store"; -export default () => { - console.log("strawberry"); -}; +export { default as ApolloController } from "./src/ApolloController"; +export { default as Atom } from "./src/Atom"; +export { default as Controller } from "./src/Controller"; +export { default as Model } from "./src/Model"; +export { default as Molecule } from "./src/Molecule"; +export { default as store } from "./src/store"; diff --git a/src/Atom.ts b/src/Atom.ts index 473c2e2..4144ee2 100644 --- a/src/Atom.ts +++ b/src/Atom.ts @@ -1,4 +1,4 @@ -import * as React from "react"; +import React from "react"; import store from "./store"; import Proton from "./Proton"; diff --git a/src/Molecule.ts b/src/Molecule.ts index 79ceec0..ef9f6ed 100644 --- a/src/Molecule.ts +++ b/src/Molecule.ts @@ -1,4 +1,4 @@ -import * as React from "react"; +import React from "react"; import Atom from "./Atom"; class Molecule extends Atom { diff --git a/src/Muon.ts b/src/Muon.ts index aca245e..1fcf119 100644 --- a/src/Muon.ts +++ b/src/Muon.ts @@ -1,22 +1,17 @@ // @ts-nocheck -import * as React from "react"; +import React from "react"; import store from "./store"; -import * as _ from "lodash"; +import _ from "lodash"; // Store <-> client state class Muon extends React.Component { - model; - attr; - storeKey; - endpoint; - reactSetState; - constructor(props) { super(props); this.model = props.model; this.attr = props.attr; - this.storeKey = props.storeKey || this.model.getKey(this.attr); + this.storeKey = + props.storeKey || (this.model && this.model.getKey(this.attr)); this.endpoint = props.endpoint; store.onUpdate(this.refresh); diff --git a/src/Proton.ts b/src/Proton.ts index 91ae323..e66e58b 100644 --- a/src/Proton.ts +++ b/src/Proton.ts @@ -1,12 +1,12 @@ // @ts-nocheck import store from "./store"; -import Muan from "./Muon"; -import * as _ from "lodash"; +import Muon from "./Muon"; +import _ from "lodash"; // Server <-> client state const _finishedRequests = []; -class Proton extends Muan { +class Proton extends Muon { protected accelerate = () => { if (this.attr) { store.getFromServer(this.model, this.attr).then(this.finishedReq); diff --git a/tsconfig.json b/tsconfig.json index 614a0c9..31028f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, // "lib": [], /* Specify library files to be included in the compilation. */ "allowJs": true /* Allow javascript files to be compiled. */, From faf3fb40acceba04919486889b7e78acbd647b35 Mon Sep 17 00:00:00 2001 From: Desmond <9451001+dezman@users.noreply.github.com> Date: Mon, 5 Jul 2021 18:26:25 -0700 Subject: [PATCH 08/15] Update and rename license to LICENSE --- LICENSE | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ license | 13 ---- 2 files changed, 226 insertions(+), 13 deletions(-) create mode 100644 LICENSE delete mode 100644 license diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a963cad --- /dev/null +++ b/LICENSE @@ -0,0 +1,226 @@ +© 2021 Desmond Sadler. All rights reserved. +© 2021 HOVER INC. +© 2021 HeyRobot LLC +© 2021 Tunelark Inc. + +team@heyrobot.shop +101 Hollister Ranch Rd. +Gaviota, CA 93117 + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + +------------------------------------------------------------------------------------------ + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/license b/license deleted file mode 100644 index 0127f8c..0000000 --- a/license +++ /dev/null @@ -1,13 +0,0 @@ -Based on https://opensource.org/licenses/MIT - -Copyright 2021 Robert Desmond Sadler - -Permission is hereby granted, free of charge, to any person obtaining a copy of the diamondhands software, contained within the current directory named diamondhands, and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included at least once in a directory named diamondhands in all copies of the Software. - -This license is only in regard to content inside the diamondhands directory. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -End license text. From 50be984cbafd14889ceec6057785ca931f95537d Mon Sep 17 00:00:00 2001 From: Desmond <9451001+dezman@users.noreply.github.com> Date: Mon, 5 Jul 2021 19:42:42 -0700 Subject: [PATCH 09/15] Update LICENSE --- LICENSE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE b/LICENSE index a963cad..eccc602 100644 --- a/LICENSE +++ b/LICENSE @@ -7,6 +7,8 @@ team@heyrobot.shop 101 Hollister Ranch Rd. Gaviota, CA 93117 +aHR0cHM6Ly9iZWF0b2Z0aGVkYXkuczMudXMtd2VzdC0xLmFtYXpvbmF3cy5jb20vYXVkaW8lMkY4MjVlNzhlZi0xODEwLTQxYjMtOTU4NC1iYzQ4ZjhlNzliYzklMkZEZXNtb25kK1R1bmVsYXJrKyUyOEEwMEI1NDg5JTI5LmFzYyAK + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at From 6276f16071c634df8d4e899f78734105602135ac Mon Sep 17 00:00:00 2001 From: Desmond Sadler Date: Tue, 6 Jul 2021 11:30:51 -0700 Subject: [PATCH 10/15] teamROBOT From 5fc2adba7c8ff6f60d0fcff8ca32f5048a99c0b2 Mon Sep 17 00:00:00 2001 From: prio101 Date: Sat, 10 Jul 2021 01:43:35 +0600 Subject: [PATCH 11/15] publish: Added local npmrc and token --- .npmrc | 1 + package.json | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..2f32178 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +//npm.pkg.github.com/:_authToken=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 \ No newline at end of file diff --git a/package.json b/package.json index 03bfcce..0eae1df 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "diamondhands", + "name": "@HeyRobotShop/diamondhands", "version": "0.1.3", "description": "MVC OO React", "main": "dist/index.js", @@ -11,7 +11,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/hoverinc/diamondhands.git" + "url": "git+https://github.com/HeyRobotShop/diamondhands" }, "keywords": [ "React", @@ -21,9 +21,9 @@ "author": "Desmond Sadler", "license": "MIT", "bugs": { - "url": "https://github.com/hoverinc/diamondhands/issues" + "url": "https://github.com/HeyRobotShop/diamondhands/issues" }, - "homepage": "https://github.com/dezman/diamondhands#readme", + "homepage": "https://github.com/HeyRobotShop/diamondhands#readme", "dependencies": { "@apollo/client": "^3.3.20", "@types/graphql": "^14.5.0", From 8cc2e1b0f4dfb0a221487f571c48e1b90c08ba0d Mon Sep 17 00:00:00 2001 From: prio101 Date: Sat, 10 Jul 2021 12:18:03 +0600 Subject: [PATCH 12/15] Removed the Org Scope from the name --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0eae1df..c53d8e4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@HeyRobotShop/diamondhands", + "name": "diamondhands", "version": "0.1.3", "description": "MVC OO React", "main": "dist/index.js", From 19b171995fcf023092b6242b38d24e6826c6ea41 Mon Sep 17 00:00:00 2001 From: prio101 Date: Sat, 10 Jul 2021 12:23:52 +0600 Subject: [PATCH 13/15] added the Org Scope --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c53d8e4..10e5688 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "diamondhands", - "version": "0.1.3", + "name": "@HeyRobotShop/diamondhands", + "version": "0.1.5", "description": "MVC OO React", "main": "dist/index.js", "types": "dist/index.d.ts", From 26bc271d2181ff3877394db1f51c0121cc335759 Mon Sep 17 00:00:00 2001 From: prio101 Date: Fri, 16 Jul 2021 17:46:03 +0600 Subject: [PATCH 14/15] specs: added spec suits --- .npmrc | 1 - CHANGELOG.md | 6 +- dist/index.d.ts | 6 + dist/index.js | 18 + dist/src/ApolloController.d.ts | 14 + dist/src/ApolloController.js | 58 ++ dist/src/Atom.d.ts | 5 + dist/src/Atom.js | 18 + dist/src/Controller.d.ts | 16 + dist/src/Controller.js | 104 +++ dist/src/Model.d.ts | 7 + dist/src/Model.js | 35 + dist/src/Molecule.d.ts | 5 + dist/src/Molecule.js | 12 + dist/src/Muon.d.ts | 13 + dist/src/Muon.js | 78 +++ dist/src/Proton.d.ts | 9 + dist/src/Proton.js | 35 + dist/src/resolver.d.ts | 14 + dist/src/resolver.js | 41 ++ dist/src/store.d.ts | 20 + dist/src/store.js | 132 ++++ lib/jasmine_examples/Player.js | 24 + lib/jasmine_examples/Song.js | 9 + package.json | 11 +- spec/ControllerSpec.ts | 12 + spec/ModelSpec.ts | 39 ++ spec/helpers/jasmine_examples/SpecHelper.js | 15 + spec/jasmine_examples/PlayerSpec.js | 60 ++ spec/support/jasmine.json | 20 + src/ApolloController.ts | 6 - src/Controller.ts | 7 +- src/Model.ts | 6 +- src/resolver.ts | 6 +- src/store.ts | 4 +- yarn-error.log | 523 ++++++++++++++ yarn.lock | 712 +++++++++++++++++++- 37 files changed, 2079 insertions(+), 22 deletions(-) delete mode 100644 .npmrc create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/src/ApolloController.d.ts create mode 100644 dist/src/ApolloController.js create mode 100644 dist/src/Atom.d.ts create mode 100644 dist/src/Atom.js create mode 100644 dist/src/Controller.d.ts create mode 100644 dist/src/Controller.js create mode 100644 dist/src/Model.d.ts create mode 100644 dist/src/Model.js create mode 100644 dist/src/Molecule.d.ts create mode 100644 dist/src/Molecule.js create mode 100644 dist/src/Muon.d.ts create mode 100644 dist/src/Muon.js create mode 100644 dist/src/Proton.d.ts create mode 100644 dist/src/Proton.js create mode 100644 dist/src/resolver.d.ts create mode 100644 dist/src/resolver.js create mode 100644 dist/src/store.d.ts create mode 100644 dist/src/store.js create mode 100644 lib/jasmine_examples/Player.js create mode 100644 lib/jasmine_examples/Song.js create mode 100644 spec/ControllerSpec.ts create mode 100644 spec/ModelSpec.ts create mode 100644 spec/helpers/jasmine_examples/SpecHelper.js create mode 100644 spec/jasmine_examples/PlayerSpec.js create mode 100644 spec/support/jasmine.json create mode 100644 yarn-error.log diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 2f32178..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -//npm.pkg.github.com/:_authToken=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 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c7a8d08..d611374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,4 +5,8 @@ ### Version 0.1.3 -- Added the JS compilation \ No newline at end of file +- Added the JS compilation + +### Version 0.1.5 + +- Added the NPM Registry \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..fdfb686 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,6 @@ +export { default as ApolloController } from "./src/ApolloController"; +export { default as Atom } from "./src/Atom"; +export { default as Controller } from "./src/Controller"; +export { default as Model } from "./src/Model"; +export { default as Molecule } from "./src/Molecule"; +export { default as store } from "./src/store"; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..56d099d --- /dev/null +++ b/dist/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.store = exports.Molecule = exports.Model = exports.Controller = exports.Atom = exports.ApolloController = void 0; +var ApolloController_1 = require("./src/ApolloController"); +Object.defineProperty(exports, "ApolloController", { enumerable: true, get: function () { return __importDefault(ApolloController_1).default; } }); +var Atom_1 = require("./src/Atom"); +Object.defineProperty(exports, "Atom", { enumerable: true, get: function () { return __importDefault(Atom_1).default; } }); +var Controller_1 = require("./src/Controller"); +Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return __importDefault(Controller_1).default; } }); +var Model_1 = require("./src/Model"); +Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return __importDefault(Model_1).default; } }); +var Molecule_1 = require("./src/Molecule"); +Object.defineProperty(exports, "Molecule", { enumerable: true, get: function () { return __importDefault(Molecule_1).default; } }); +var store_1 = require("./src/store"); +Object.defineProperty(exports, "store", { enumerable: true, get: function () { return __importDefault(store_1).default; } }); diff --git a/dist/src/ApolloController.d.ts b/dist/src/ApolloController.d.ts new file mode 100644 index 0000000..c8b8936 --- /dev/null +++ b/dist/src/ApolloController.d.ts @@ -0,0 +1,14 @@ +import Controller from "./Controller"; +declare const setDiamondhandsClients: (obj: { + client: string; +}) => void; +declare class ApolloController extends Controller { + constructor(); + private baseQueryOptions; + gqlAttribute: ({ client, action, variables }: any) => Promise; + private handleApolloError; + private handleApolloSuccess; + private queryOptions; +} +export default ApolloController; +export { setDiamondhandsClients as setDiamondhandsClients }; diff --git a/dist/src/ApolloController.js b/dist/src/ApolloController.js new file mode 100644 index 0000000..15c69d5 --- /dev/null +++ b/dist/src/ApolloController.js @@ -0,0 +1,58 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setDiamondhandsClients = void 0; +const Controller_1 = __importDefault(require("./Controller")); +let diamondhandsClients = {}; +const setDiamondhandsClients = (obj) => { + diamondhandsClients = obj; +}; +exports.setDiamondhandsClients = setDiamondhandsClients; +class ApolloController extends Controller_1.default { + constructor() { + super(); + this.baseQueryOptions = { + errorPolicy: "none", + fetchPolicy: "cache-first", + notifyOnNetworkStatusChange: true, + returnPartialData: false, + }; + this.gqlAttribute = ({ client, action, variables }) => { + if (!this.controllerActionValid(action)) + return; + console.log("dev", "🎛 Controller#gqlAttribute", `🪡 ${action}`); + const queryOptions = this.queryOptions(action, variables); + const promise = new Promise((resolve, reject) => { + // GraphQL fetch + return diamondhandsClients(client) + .query(queryOptions) + .then((res) => this.handleApolloSuccess(res, resolve)) + .catch((res) => this.handleApolloError(res, reject)); + }); + return promise; + }; + // private + this.handleApolloError = (e, reject) => { + if (e.message.match("authentication")) { + alert("🪵 Please log in to your server."); + } + console.error("⛔️ Error:", e); + reject(e); + }; + this.handleApolloSuccess = (res, resolve) => { + console.log("dev", "✅ Success:", res); + resolve(res.data); + this._finishStack.forEach((f) => { + f(res.data); + }); + }; + } + queryOptions(action, variables) { + if (variables) + console.log("dev", "🔮 Query variables:", variables); + return Object.assign(Object.assign({}, this.baseQueryOptions), { query: this.requestBody(action), variables: variables, operationName: action }); + } +} +exports.default = ApolloController; diff --git a/dist/src/Atom.d.ts b/dist/src/Atom.d.ts new file mode 100644 index 0000000..7f35091 --- /dev/null +++ b/dist/src/Atom.d.ts @@ -0,0 +1,5 @@ +import Proton from "./Proton"; +declare class Atom extends Proton { + constructor(props: any); +} +export default Atom; diff --git a/dist/src/Atom.js b/dist/src/Atom.js new file mode 100644 index 0000000..badba49 --- /dev/null +++ b/dist/src/Atom.js @@ -0,0 +1,18 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Proton_1 = __importDefault(require("./Proton")); +class Atom extends Proton_1.default { + constructor(props) { + super(props); + if (props.molecule) + return; + if (Object.keys(this.state).length !== 1) { + console.error("↳ ⚛ Atoms can only have once piece of state. ⚛"); + console.log("dev", this); + } + } +} +exports.default = Atom; diff --git a/dist/src/Controller.d.ts b/dist/src/Controller.d.ts new file mode 100644 index 0000000..721773e --- /dev/null +++ b/dist/src/Controller.d.ts @@ -0,0 +1,16 @@ +declare class Controller { + _finishStack: any[]; + getAttribute(action: any): Promise; + basicFetch(path: any, body: any): Promise; + controllerFetch(method: any, path: any, body: any): Promise; + onFinishedFetching(f: any): string; + protected requestBody: (action: any) => any; + protected controllerActionValid(action: any): true | void; + private server; + private success; + private fail; + private always; + private fetchOptions; + private basicFetchOptions; +} +export default Controller; diff --git a/dist/src/Controller.js b/dist/src/Controller.js new file mode 100644 index 0000000..6021f81 --- /dev/null +++ b/dist/src/Controller.js @@ -0,0 +1,104 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// @ts-nocheck +const isomorphic_fetch_1 = __importDefault(require("isomorphic-fetch")); +const store_1 = __importDefault(require("./store")); +// import $ from "jquery"; +class Controller { + constructor() { + this._finishStack = []; + // protected + this.requestBody = (action) => { + const body = this[action](); + if (body) { + console.log("dev", "🌮 Request body:", body, this); + } + else { + console.error("🍽 Empty request body:", body, this); + } + return body; + }; + this.success = (res) => { + console.log("debug", "✅ Success:", res); + this._finishStack.forEach((f) => { + f(res.data); + }); + this._finishStack = []; + return res; + }; + this.fail = (res) => { + console.log("dev", "❌ Fail:", res); + console.log("dev", "🏗 Check your server & your ngrok tunnel."); + return res; + }; + this.always = (res) => { + console.log("debug", "👾 Always:", res); + return res; + }; + } + getAttribute(action) { + if (!this.controllerActionValid(action)) + return; + console.log("debug", "🎛 Controller#getAttribute", `🪡 ${action}`); + return this.controllerFetch(...this.requestBody(action)); + } + // Plain text fetch + basicFetch(path, body) { + return isomorphic_fetch_1.default(path, this.basicFetchOptions(body)).then((res) => res.text()); + } + // Rest fetch + controllerFetch(method, path, body) { + return isomorphic_fetch_1.default(`${this.server()}${path}`, this.fetchOptions(method, body)) + .then((res) => res.json()) + .then(this.success) // https://github.com/github/fetch/issues/223#issuecomment-148927226 + .catch(this.fail) + .then(this.always, this.always); + } + onFinishedFetching(f) { + this._finishStack.push(f); + return "ok"; + } + controllerActionValid(action) { + if (action === "" || action === undefined || action === null) { + return console.error("🛂 Please pass in an attribute resolver defined on a model, such as user.ts `firstName`."); + } + else { + return true; + } + } + // private + server() { + const baseUrl = store_1.default.get("serverProps.env.server_url"); + console.log("dev", `🎩 Server: ${baseUrl}`); + return baseUrl; + } + fetchOptions(method, body) { + return { + method: method, + mode: "cors", + cache: "no-cache", + headers: { + "Content-Type": "application/json; charset=UTF-8", + Accept: "application/json", + }, + body: JSON.stringify(body), + credentials: "include", + }; + } + basicFetchOptions(body) { + return { + method: "GET", + mode: "cors", + cache: "no-cache", + headers: { + "Content-Type": "text/plain", + }, + body: body, + credentials: "include", + }; + } +} +exports.default = Controller; diff --git a/dist/src/Model.d.ts b/dist/src/Model.d.ts new file mode 100644 index 0000000..2131367 --- /dev/null +++ b/dist/src/Model.d.ts @@ -0,0 +1,7 @@ +declare class Model { + constructor(id: any); + hydrate(obj: any): this; + private getKey; + private generateResolver; +} +export default Model; diff --git a/dist/src/Model.js b/dist/src/Model.js new file mode 100644 index 0000000..294bb1b --- /dev/null +++ b/dist/src/Model.js @@ -0,0 +1,35 @@ +"use strict"; +// @ts-nocheck +// Validation logic +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const resolver_1 = __importDefault(require("./resolver")); +class Model { + constructor(id) { + this.id = id; + this.data = {}; + this.name = this.name(); + this.resolvers().forEach(this.generateResolver); + } + hydrate(obj) { + this.data = obj; + return this; + } + getKey(attr) { + return `${this.name}.${attr}`; + } + // private + generateResolver({ endpoint, attr, Value, Edit }) { + console.log(`dev", "👀 Resolver for:`); + this[attr] = resolver_1.default({ + endpoint: endpoint, + model: this, + attr: attr, + Value: Value, + Edit: Edit, + }); + } +} +exports.default = Model; diff --git a/dist/src/Molecule.d.ts b/dist/src/Molecule.d.ts new file mode 100644 index 0000000..0396673 --- /dev/null +++ b/dist/src/Molecule.d.ts @@ -0,0 +1,5 @@ +import Atom from "./Atom"; +declare class Molecule extends Atom { + constructor(props: any); +} +export default Molecule; diff --git a/dist/src/Molecule.js b/dist/src/Molecule.js new file mode 100644 index 0000000..945fab1 --- /dev/null +++ b/dist/src/Molecule.js @@ -0,0 +1,12 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Atom_1 = __importDefault(require("./Atom")); +class Molecule extends Atom_1.default { + constructor(props) { + super(Object.assign(Object.assign({}, props), { molecule: true })); + } +} +exports.default = Molecule; diff --git a/dist/src/Muon.d.ts b/dist/src/Muon.d.ts new file mode 100644 index 0000000..89587f9 --- /dev/null +++ b/dist/src/Muon.d.ts @@ -0,0 +1,13 @@ +import React from "react"; +declare class Muon extends React.Component { + constructor(props: any); + protected quark(): any; + protected componentDidMount(): void; + protected componentWillUnmount(): void; + protected onChange: (e: any) => void; + protected isFetching(): boolean; + private diamondHandsSetState; + private refresh; + private storeValue; +} +export default Muon; diff --git a/dist/src/Muon.js b/dist/src/Muon.js new file mode 100644 index 0000000..5aaec30 --- /dev/null +++ b/dist/src/Muon.js @@ -0,0 +1,78 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// @ts-nocheck +const react_1 = __importDefault(require("react")); +const store_1 = __importDefault(require("./store")); +// Store <-> client state +class Muon extends react_1.default.Component { + constructor(props) { + super(props); + this.onChange = (e) => { + let newStoreState = {}; + const newKeyValue = e.target.value; + newStoreState[`${this.storeKey}`] = newKeyValue; + store_1.default.set(newStoreState); + this.setState({ value: newKeyValue }); + }; + this.refresh = () => { + if (!this.mounted) + return; + console.log("debug", "🌊 Muon refresh:", this.quark()); + this.forceUpdate(); + }; + this.storeValue = () => { + const value = store_1.default.get(this.storeKey); + if (this.attr) { + console.log("debug", `🧬 Quark attr:`, this.attr); + if (value) { + console.log("debug", `🧩`, `Quark value: ${value}`); + } + else { + if (this.isFetching()) + console.log("dev", `🧩`, "Fetching..."); + } + } + return value || ""; + }; + this.model = props.model; + this.attr = props.attr; + this.storeKey = + props.storeKey || (this.model && this.model.getKey(this.attr)); + this.endpoint = props.endpoint; + store_1.default.onUpdate(this.refresh); + this.reactSetState = this.setState; + this.setState = () => this.diamondHandsSetState.apply(this, arguments); + this.state = { + value: "", + }; + } + quark() { + // return if quark is already set + if (this.state.value.length) + return this.state.value; + if (!this.storeKey) { + console.log("dev", `🗝 You need a store key in your component to get a value.`); + console.log("dev", `↳`, this); + } + return this.storeValue(); + } + componentDidMount() { + this.mounted = true; + } + componentWillUnmount() { + this.mounted = false; + } + isFetching() { + return this.proton && !this.isFinishedReq(); + } + // private + diamondHandsSetState(state) { + if (!this.mounted) + return; + this.reactSetState(state); + } +} +exports.default = Muon; diff --git a/dist/src/Proton.d.ts b/dist/src/Proton.d.ts new file mode 100644 index 0000000..44603d5 --- /dev/null +++ b/dist/src/Proton.d.ts @@ -0,0 +1,9 @@ +import Muon from "./Muon"; +declare class Proton extends Muon { + protected accelerate: () => void; + protected onBlur: () => void; + protected isFinishedReq(): boolean; + protected finishedReq: () => void; + protected componentDidMount(): void; +} +export default Proton; diff --git a/dist/src/Proton.js b/dist/src/Proton.js new file mode 100644 index 0000000..f4929b2 --- /dev/null +++ b/dist/src/Proton.js @@ -0,0 +1,35 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// @ts-nocheck +const store_1 = __importDefault(require("./store")); +const Muon_1 = __importDefault(require("./Muon")); +const lodash_1 = __importDefault(require("lodash")); +// Server <-> client state +const _finishedRequests = []; +class Proton extends Muon_1.default { + constructor() { + super(...arguments); + this.accelerate = () => { + if (this.attr) { + store_1.default.getFromServer(this.model, this.attr).then(this.finishedReq); + } + }; + this.onBlur = () => { + // TODO: Save + }; + this.finishedReq = () => { + _finishedRequests.push(this); + }; + } + isFinishedReq() { + return lodash_1.default.includes(_finishedRequests, this); + } + componentDidMount() { + this.mounted = true; + this.accelerate(); + } +} +exports.default = Proton; diff --git a/dist/src/resolver.d.ts b/dist/src/resolver.d.ts new file mode 100644 index 0000000..0d27851 --- /dev/null +++ b/dist/src/resolver.d.ts @@ -0,0 +1,14 @@ +import Proton from "./Proton"; +declare class Resolver extends Proton { + value(): void; + edit(): void; + query(variables: any): any; +} +declare const resolver: ({ endpoint, model, attr, Value, Edit }: { + endpoint: any; + model: any; + attr: any; + Value: any; + Edit: any; +}) => Resolver; +export default resolver; diff --git a/dist/src/resolver.js b/dist/src/resolver.js new file mode 100644 index 0000000..0c7f0b3 --- /dev/null +++ b/dist/src/resolver.js @@ -0,0 +1,41 @@ +"use strict"; +// @ts-nocheck +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// import * as React from "react"; +const Proton_1 = __importDefault(require("./Proton")); +// import View from './components/View' +let value = null; +class Resolver extends Proton_1.default { + value() { + const Value = this.props.Value; + // return ( + // + // ) + } + edit() { + const Edit = this.props.Edit; + // return ( + // // + // ) + } + query(variables) { + return this.model.controller.gqlAttribute({ + client: this.model.controller.client(), + action: this.props.attr, + variables: variables, + }); + } +} +// const resolver = ({ endpoint, model, attr, Value, Edit }) => { +const resolver = ({ endpoint, model, attr, Value, Edit }) => { + return new Resolver({ + model: model, + attr: attr, + Value: Value, + Edit: Edit, + }); +}; +exports.default = resolver; diff --git a/dist/src/store.d.ts b/dist/src/store.d.ts new file mode 100644 index 0000000..94990aa --- /dev/null +++ b/dist/src/store.d.ts @@ -0,0 +1,20 @@ +declare class Store { + private state; + private requestTracker; + private onUpdateStack; + private waitingForKeys; + constructor(initialState: any); + set(newState: any): void; + get(passKey: any): any; + getFromServer(model: any, attr: any): any; + waitFor(passKey: any, f: any): any; + onUpdate: (f: any) => string; + private checkWaitFor; + private isGraphql; + private cacheKey; + private handleServerResponse; + private valid; + private debug; +} +declare const store: Store; +export default store; diff --git a/dist/src/store.js b/dist/src/store.js new file mode 100644 index 0000000..34de792 --- /dev/null +++ b/dist/src/store.js @@ -0,0 +1,132 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// @ts-nocheck +const lodash_1 = __importDefault(require("lodash")); +class Store { + constructor(initialState) { + this.requestTracker = {}; + this.onUpdateStack = []; + this.waitingForKeys = {}; + this.onUpdate = (f) => { + console.log("all", "🥞 Store#onUpdate:", f); + this.onUpdateStack.push(f); + return "ok"; + }; + this.handleServerResponse = (attr, model, res) => { + console.log("dev", "📜 Response:", res); + let newStateObj = {}; + // Save new state to store + const relevantData = lodash_1.default(res).get(model.controller.accessor()); + if (relevantData.results) { + newStateObj[model.name] = newStateObj[model.name] || {}; + newStateObj[model.name][attr] = relevantData.results; + } + else { + newStateObj[model.name] = relevantData; + } + this.set(newStateObj); + }; + this.debug = () => { + if (this.state) + console.log("dev", "🍱", this.state); + return this.state; + }; + this.state = initialState; + console.log("debug", "🗺 Store ctx:", this); + console.debug = this.debug; + } + set(newState) { + console.log("debug", "🚮 Old state:", this.state); + console.log("debug", "💽 New state:", newState); + // Object.assign not recommended for deep merge + this.state = lodash_1.default.merge(this.state, newState); + console.setTimeout(() => { + console.log("dev", "🍱 Store state:", this.state); + this.checkWaitFor(); + this.onUpdateStack.forEach((f) => { + console.log("all", "🥞 Store onUpdateStack:", f); + f(this.state); + }); + }, 0); + } + get(passKey) { + console.log("debug", "💅 Store#get:", passKey); + if (!passKey || passKey === "") { + console.error("🙈 Invalid store request: ", arguments); + } + return this.cacheKey(passKey); + } + getFromServer(model, attr) { + // Already requested it + if (this.requestTracker[attr]) + return this.requestTracker[attr]; + if (!attr || !model) { + console.error("🙈 Invalid store request: ", attr, model); + } + model.controller.onFinishedFetching((res) => { + this.handleServerResponse(attr, model, res); + }); + console.log("dev", "🌀 Starting get from server...", model.name, attr); + if (this.isGraphql(model, attr)) { + this.requestTracker[attr] = model.controller.gqlAttribute({ + client: model.controller.client(), + action: attr, + }); + } + else { + this.requestTracker[attr] = model.controller.getAttribute(attr); + } + return this.requestTracker[attr]; + } + waitFor(passKey, f) { + const value = this.get(passKey); + if (this.valid(value)) { + return f(value); + } + if (lodash_1.default.includes(this.waitingForKeys[passKey], f)) { + return; + } + if (this.waitingForKeys[passKey]) { + this.waitingForKeys[passKey].push(f); + } + else { + this.waitingForKeys[passKey] = [f]; + } + } + // private + checkWaitFor() { + console.log("debug", "🧳 Check wait for:", Object.keys(this.waitingForKeys)); + Object.keys(this.waitingForKeys).forEach((passKey) => { + const value = this.get(passKey); + console.log("debug", "🧳 Value:", value); + if (this.valid(value)) { + this.waitingForKeys[passKey].forEach((f) => { + console.log("debug", "🧳 Wait for callback called:", f); + f(value); + }); + console.log("debug", "🧳 Destroyed:", this.waitingForKeys[passKey]); + delete this.waitingForKeys[passKey]; + } + }); + } + isGraphql(model, attr) { + return model.controller.requestBody(attr).kind === "Document"; + } + cacheKey(passKey) { + const cachedValue = lodash_1.default.get(this.state, passKey); + if (this.valid(cachedValue)) { + console.log("debug", "💰 Cached value:", cachedValue); + return cachedValue; + } + } + valid(x) { + console.log("debug", "🦆 Store#valid type:", typeof x); + return !lodash_1.default.isNil(x) && !lodash_1.default.isNaN(x); + } +} +const initialState = {}; +const store = new Store(initialState); +exports.default = store; diff --git a/lib/jasmine_examples/Player.js b/lib/jasmine_examples/Player.js new file mode 100644 index 0000000..fe95f89 --- /dev/null +++ b/lib/jasmine_examples/Player.js @@ -0,0 +1,24 @@ +function Player() { +} +Player.prototype.play = function(song) { + this.currentlyPlayingSong = song; + this.isPlaying = true; +}; + +Player.prototype.pause = function() { + this.isPlaying = false; +}; + +Player.prototype.resume = function() { + if (this.isPlaying) { + throw new Error("song is already playing"); + } + + this.isPlaying = true; +}; + +Player.prototype.makeFavorite = function() { + this.currentlyPlayingSong.persistFavoriteStatus(true); +}; + +module.exports = Player; diff --git a/lib/jasmine_examples/Song.js b/lib/jasmine_examples/Song.js new file mode 100644 index 0000000..3415bb8 --- /dev/null +++ b/lib/jasmine_examples/Song.js @@ -0,0 +1,9 @@ +function Song() { +} + +Song.prototype.persistFavoriteStatus = function(value) { + // something complicated + throw new Error("not yet implemented"); +}; + +module.exports = Song; diff --git a/package.json b/package.json index 10e5688..53401fc 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@HeyRobotShop/diamondhands", + "name": "diamondhands", "version": "0.1.5", "description": "MVC OO React", "main": "dist/index.js", @@ -7,7 +7,7 @@ "scripts": { "dev": "tsc-watch --noClear -p ./tsconfig.json --onSuccess \"node ./dist/server.js\"", "build": "tsc", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "jasmine-ts --config=spec/support/jasmine.json" }, "repository": { "type": "git", @@ -28,15 +28,22 @@ "@apollo/client": "^3.3.20", "@types/graphql": "^14.5.0", "@types/isomorphic-fetch": "^0.0.35", + "@types/jasmine": "^3.8.1", "@types/lodash": "^4.14.170", "@types/react": "^17.0.11", + "fetch-mock": "^9.11.0", "isomorphic-fetch": "^3.0.0", + "jasmine-ts": "^0.4.0", "jquery": "^3.6.0", "lodash": "^4.17.21", + "ts-node": "^10.1.0", "tsc-watch": "^4.4.0", "typescript-transpile-only": "^0.0.4" }, "devDependencies": { + "@types/jasmine-ajax": "^3.3.3", + "jasmine": "^3.8.0", + "jasmine-ajax": "^4.0.0", "react": "^17.0.2", "typescript": "^4.3.4" } diff --git a/spec/ControllerSpec.ts b/spec/ControllerSpec.ts new file mode 100644 index 0000000..47e9c41 --- /dev/null +++ b/spec/ControllerSpec.ts @@ -0,0 +1,12 @@ +import Controller from '../src/Controller'; +import fetchMock from 'fetch-mock' + +describe('.onFinishedFetching', () => { + + it('should return OK', () =>{ + let controller = new Controller(); + expect(controller.onFinishedFetching('Function')).toBe('ok') + }) + +}); + diff --git a/spec/ModelSpec.ts b/spec/ModelSpec.ts new file mode 100644 index 0000000..5f4c180 --- /dev/null +++ b/spec/ModelSpec.ts @@ -0,0 +1,39 @@ +import { extend } from 'lodash'; +import Model from '../src/Model'; +import Resolver from '../src/resolver'; + + +describe("Model", ()=> { + describe(".hydrate", () =>{ + let id, exampleModel, resolever ; + + beforeEach(()=> { + + + class ExampleModel extends Model { + constructor(){ + id = 1 + super(id); + } + + name() { + return "examples" + } + + resolvers() { + return [{ + attr: "index" + }] + } + } + + // exampleModel = new ExampleModel(); + + }) + + it("should return the obejct", () => { + // expect(exampleModel.hydrate).toBeInstanceOf(Model); + }); + + }) +}) \ No newline at end of file diff --git a/spec/helpers/jasmine_examples/SpecHelper.js b/spec/helpers/jasmine_examples/SpecHelper.js new file mode 100644 index 0000000..578b3e8 --- /dev/null +++ b/spec/helpers/jasmine_examples/SpecHelper.js @@ -0,0 +1,15 @@ +beforeEach(function () { + jasmine.addMatchers({ + toBePlaying: function () { + return { + compare: function (actual, expected) { + var player = actual; + + return { + pass: player.currentlyPlayingSong === expected && player.isPlaying + } + } + }; + } + }); +}); diff --git a/spec/jasmine_examples/PlayerSpec.js b/spec/jasmine_examples/PlayerSpec.js new file mode 100644 index 0000000..80f149e --- /dev/null +++ b/spec/jasmine_examples/PlayerSpec.js @@ -0,0 +1,60 @@ +describe("Player", function() { + var Player = require('../../lib/jasmine_examples/Player'); + var Song = require('../../lib/jasmine_examples/Song'); + var player; + var song; + + beforeEach(function() { + player = new Player(); + song = new Song(); + }); + + it("should be able to play a Song", function() { + player.play(song); + expect(player.currentlyPlayingSong).toEqual(song); + + //demonstrates use of custom matcher + expect(player).toBePlaying(song); + }); + + describe("when song has been paused", function() { + beforeEach(function() { + player.play(song); + player.pause(); + }); + + it("should indicate that the song is currently paused", function() { + expect(player.isPlaying).toBeFalsy(); + + // demonstrates use of 'not' with a custom matcher + expect(player).not.toBePlaying(song); + }); + + it("should be possible to resume", function() { + player.resume(); + expect(player.isPlaying).toBeTruthy(); + expect(player.currentlyPlayingSong).toEqual(song); + }); + }); + + // demonstrates use of spies to intercept and test method calls + it("tells the current song if the user has made it a favorite", function() { + spyOn(song, 'persistFavoriteStatus'); + + player.play(song); + player.makeFavorite(); + + expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true); + }); + + //demonstrates use of expected exceptions + describe("#resume", function() { + it("should throw an exception if song is already playing", function() { + player.play(song); + + expect(function() { + player.resume(); + }).toThrowError("song is already playing"); + }); + }); +}); diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json new file mode 100644 index 0000000..7066e7d --- /dev/null +++ b/spec/support/jasmine.json @@ -0,0 +1,20 @@ +{ + "spec_dir": "spec", + "spec_files": [ + "**/*[sS]pec.js", "**/*[sS]pec.ts" + ], + "helpers": [ + "helpers/**/*.js" + ], + "stopSpecOnExpectationFailure": false, + "stopOnSpecFailure": false, + "random": false, + "reporters": [ + { + "name": "jasmine-spec-reporter#SpecReporter", + "options": { + "displayStacktrace": "all" + } + } + ] +} diff --git a/src/ApolloController.ts b/src/ApolloController.ts index 296f83c..245bcd7 100644 --- a/src/ApolloController.ts +++ b/src/ApolloController.ts @@ -9,12 +9,6 @@ const setDiamondhandsClients = (obj: { client: string }) => { diamondhandsClients = obj; }; -interface GqlAttr { - client: String; - action: String; - variables: any; //chane to type -} - class ApolloController extends Controller { constructor() { super(); diff --git a/src/Controller.ts b/src/Controller.ts index 8dc00d0..9ee19ca 100644 --- a/src/Controller.ts +++ b/src/Controller.ts @@ -10,8 +10,7 @@ class Controller { if (!this.controllerActionValid(action)) return; console.log("debug", "🎛 Controller#getAttribute", `🪡 ${action}`); - // return this.controllerFetch( ...this.requestBody(action) ); - console.warn("Not implimented yet"); + //return this.controllerFetch( ...this.requestBody(action) ); } // Plain text fetch @@ -33,6 +32,9 @@ class Controller { return "ok"; } + + // protected + protected requestBody = (action) => { const body = this[action](); @@ -44,7 +46,6 @@ class Controller { return body; }; - // protected protected controllerActionValid(action) { if (action === "" || action === undefined || action === null) { diff --git a/src/Model.ts b/src/Model.ts index dcd4d7e..9a564ec 100644 --- a/src/Model.ts +++ b/src/Model.ts @@ -8,7 +8,7 @@ class Model { this.id = id; this.data = {}; this.name = this.name(); - + this.resolvers().forEach(this.generateResolver); } @@ -22,9 +22,9 @@ class Model { } // private - + private generateResolver({ endpoint, attr, Value, Edit }) { - console.log("dev", "👀 Resolver for:", [this.name].concat(arguments)); + console.log(`dev", "👀 Resolver for:`); this[attr] = resolver({ endpoint: endpoint, diff --git a/src/resolver.ts b/src/resolver.ts index 64eb97d..24c7270 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -29,12 +29,12 @@ class Resolver extends Proton { } } // const resolver = ({ endpoint, model, attr, Value, Edit }) => { -const resolver = ({ endpoint, model, attr }) => { +const resolver = ({ endpoint, model, attr, Value, Edit }) => { return new Resolver({ model: model, attr: attr, - // Value: Value, - // Edit: Edit, + Value: Value, + Edit: Edit, }); }; export default resolver; diff --git a/src/store.ts b/src/store.ts index a6cd23e..d12d9ea 100644 --- a/src/store.ts +++ b/src/store.ts @@ -11,7 +11,7 @@ class Store { this.state = initialState; console.log("debug", "🗺 Store ctx:", this); - window.bug = this.debug; + console.debug = this.debug; } public set(newState) { @@ -21,7 +21,7 @@ class Store { // Object.assign not recommended for deep merge this.state = _.merge(this.state, newState); - window.setTimeout(() => { + console.setTimeout(() => { console.log("dev", "🍱 Store state:", this.state); this.checkWaitFor(); diff --git a/yarn-error.log b/yarn-error.log new file mode 100644 index 0000000..abe58a7 --- /dev/null +++ b/yarn-error.log @@ -0,0 +1,523 @@ +Arguments: + /home/prio/.nvm/versions/node/v14.16.1/bin/node /home/prio/.nvm/versions/node/v14.16.1/bin/yarn run test + +PATH: + /home/prio/.nvm/versions/node/v14.16.1/bin:/usr/local/bin:/usr/local/sbin:/home/prio/.rvm/gems/ruby-3.0.0/bin:/home/prio/.rvm/gems/ruby-3.0.0@global/bin:/home/prio/.rvm/rubies/ruby-3.0.0/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/prio/.rvm/bin:/home/prio/.rvm/bin:/home/prio/.fzf/bin + +Yarn version: + 1.22.10 + +Node version: + 14.16.1 + +Platform: + linux x64 + +Trace: + SyntaxError: /home/prio/Desktop/work/HeyRobot/diamondhands/package.json: Unexpected token / in JSON at position 279 + at JSON.parse () + at /home/prio/.nvm/versions/node/v14.16.1/lib/node_modules/yarn/lib/cli.js:1625:59 + at Generator.next () + at step (/home/prio/.nvm/versions/node/v14.16.1/lib/node_modules/yarn/lib/cli.js:310:30) + at /home/prio/.nvm/versions/node/v14.16.1/lib/node_modules/yarn/lib/cli.js:321:13 + +npm manifest: + { + "name": "heyrobot_diamondhands", + "version": "0.1.5", + "description": "MVC OO React", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "dev": "tsc-watch --noClear -p ./tsconfig.json --onSuccess \"node ./dist/server.js\"", + "build": "tsc", + // "test": "echo \"Error: no test specified\" && exit 1", + "test": "jasmine-ts --config=jasmine.json" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/HeyRobotShop/diamondhands" + }, + "keywords": [ + "React", + "Rails", + "MVC" + ], + "author": "Desmond Sadler", + "license": "MIT", + "bugs": { + "url": "https://github.com/HeyRobotShop/diamondhands/issues" + }, + "homepage": "https://github.com/HeyRobotShop/diamondhands#readme", + "dependencies": { + "@apollo/client": "^3.3.20", + "@types/graphql": "^14.5.0", + "@types/isomorphic-fetch": "^0.0.35", + "@types/lodash": "^4.14.170", + "@types/react": "^17.0.11", + "isomorphic-fetch": "^3.0.0", + "jquery": "^3.6.0", + "lodash": "^4.17.21", + "tsc-watch": "^4.4.0", + "typescript-transpile-only": "^0.0.4" + }, + "devDependencies": { + "jasmine": "^3.8.0", + "react": "^17.0.2", + "typescript": "^4.3.4" + } + } + +yarn manifest: + No manifest + +Lockfile: + # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + # yarn lockfile v1 + + + "@apollo/client@^3.3.20": + version "3.3.20" + resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.3.20.tgz#8f0935fa991857e9cf2e73c9bd378ad7ec97caf8" + integrity sha512-hS7UmBwJweudw/J3M0RAcusMHNiRuGqkRH6g91PM2ev8cXScIMdXr/++9jo7wD1nAITMCMF4HQQ3LFaw/Or0Bw== + dependencies: + "@graphql-typed-document-node/core" "^3.0.0" + "@types/zen-observable" "^0.8.0" + "@wry/context" "^0.6.0" + "@wry/equality" "^0.5.0" + fast-json-stable-stringify "^2.0.0" + graphql-tag "^2.12.0" + hoist-non-react-statics "^3.3.2" + optimism "^0.16.0" + prop-types "^15.7.2" + symbol-observable "^4.0.0" + ts-invariant "^0.7.0" + tslib "^1.10.0" + zen-observable "^0.8.14" + + "@graphql-typed-document-node/core@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950" + integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg== + + "@types/graphql@^14.5.0": + version "14.5.0" + resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-14.5.0.tgz#a545fb3bc8013a3547cf2f07f5e13a33642b75d6" + integrity sha512-MOkzsEp1Jk5bXuAsHsUi6BVv0zCO+7/2PTiZMXWDSsMXvNU6w/PLMQT2vHn8hy2i0JqojPz1Sz6rsFjHtsU0lA== + dependencies: + graphql "*" + + "@types/isomorphic-fetch@^0.0.35": + version "0.0.35" + resolved "https://registry.yarnpkg.com/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.35.tgz#c1c0d402daac324582b6186b91f8905340ea3361" + integrity sha512-DaZNUvLDCAnCTjgwxgiL1eQdxIKEpNLOlTNtAgnZc50bG2copGhRrFN9/PxPBuJe+tZVLCbQ7ls0xveXVRPkvw== + + "@types/lodash@^4.14.170": + version "4.14.170" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.170.tgz#0d67711d4bf7f4ca5147e9091b847479b87925d6" + integrity sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q== + + "@types/prop-types@*": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + + "@types/react@^17.0.11": + version "17.0.11" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.11.tgz#67fcd0ddbf5a0b083a0f94e926c7d63f3b836451" + integrity sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + + "@types/scheduler@*": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" + integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== + + "@types/zen-observable@^0.8.0": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" + integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== + + "@wry/context@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.6.0.tgz#f903eceb89d238ef7e8168ed30f4511f92d83e06" + integrity sha512-sAgendOXR8dM7stJw3FusRxFHF/ZinU0lffsA2YTyyIOfic86JX02qlPqPVqJNZJPAxFt+2EE8bvq6ZlS0Kf+Q== + dependencies: + tslib "^2.1.0" + + "@wry/equality@^0.5.0": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.1.tgz#b22e4e1674d7bf1439f8ccdccfd6a785f6de68b0" + integrity sha512-FZKbdpbcVcbDxQrKcaBClNsQaMg9nof1RKM7mReJe5DKUzM5u8S7T+PqwNqvib5O2j2xxF1R4p5O3+b6baTrbw== + dependencies: + tslib "^2.1.0" + + "@wry/trie@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.3.0.tgz#3245e74988c4e3033299e479a1bf004430752463" + integrity sha512-Yw1akIogPhAT6XPYsRHlZZIS0tIGmAl9EYXHi2scf7LPKKqdqmow/Hu4kEqP2cJR3EjaU/9L0ZlAjFf3hFxmug== + dependencies: + tslib "^2.1.0" + + ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + + balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + + brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + + concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + + cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + + csstype@^3.0.2: + version "3.0.8" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" + integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== + + duplexer@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== + + event-stream@=3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + integrity sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE= + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + + fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + + from@~0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" + integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= + + fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + + glob@^7.1.6: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + + graphql-tag@^2.12.0: + version "2.12.5" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.5.tgz#5cff974a67b417747d05c8d9f5f3cb4495d0db8f" + integrity sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ== + dependencies: + tslib "^2.1.0" + + graphql@*: + version "15.5.1" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" + integrity sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw== + + hoist-non-react-statics@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + + inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + + inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + + isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + + isomorphic-fetch@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" + integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== + dependencies: + node-fetch "^2.6.1" + whatwg-fetch "^3.4.1" + + jasmine-core@~3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.8.0.tgz#815399aae5aa5d9beeb1262805f981b99ffc9bf0" + integrity sha512-zl0nZWDrmbCiKns0NcjkFGYkVTGCPUgoHypTaj+G2AzaWus7QGoXARSlYsSle2VRpSdfJmM+hzmFKzQNhF2kHg== + + jasmine@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.8.0.tgz#4497bc797eede7ca9de18179aedd4cf50245d8dc" + integrity sha512-kdQ3SfcNpMbbMdgJPLyFe9IksixdnrgYaCJapP9sS0aLgdWdIZADNXEr+11Zafxm1VDfRSC5ZL4fzXT0bexzXw== + dependencies: + glob "^7.1.6" + jasmine-core "~3.8.0" + + jquery@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" + integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== + + "js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + + lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + + loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + + map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= + + minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + + node-cleanup@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-cleanup/-/node-cleanup-2.1.2.tgz#7ac19abd297e09a7f72a71545d951b517e4dde2c" + integrity sha1-esGavSl+Caf3KnFUXZUbUX5N3iw= + + node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + + object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + + once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + + optimism@^0.16.0: + version "0.16.1" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.1.tgz#7c8efc1f3179f18307b887e18c15c5b7133f6e7d" + integrity sha512-64i+Uw3otrndfq5kaoGNoY7pvOhSsjFEN4bdEFh80MWVk/dbgJfMv7VFDeCT8LxNAlEVhQmdVEbfE7X2nWNIIg== + dependencies: + "@wry/context" "^0.6.0" + "@wry/trie" "^0.3.0" + + path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + + path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + + pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + integrity sha1-/lo0sMvOErWqaitAPuLnO2AvFEU= + dependencies: + through "~2.3" + + prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + + ps-tree@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" + integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== + dependencies: + event-stream "=3.3.4" + + react-is@^16.7.0, react-is@^16.8.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + + react@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + + shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + + shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + + split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + integrity sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8= + dependencies: + through "2" + + stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + integrity sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ= + dependencies: + duplexer "~0.1.1" + + string-argv@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.1.2.tgz#c5b7bc03fb2b11983ba3a72333dd0559e77e4738" + integrity sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA== + + strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + + symbol-observable@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205" + integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ== + + through@2, through@~2.3, through@~2.3.1: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + + ts-invariant@^0.7.0: + version "0.7.5" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.7.5.tgz#f9658719f9a7737b117d09820d952aacf6263f9c" + integrity sha512-qfVyqTYWEqADMtncLqwpUdMjMSXnsqOeqGtj1LeJNFDjz8oqZ1YxLEp29YCOq65z0LgEiERqQ8ThVjnfibJNpg== + dependencies: + tslib "^2.1.0" + + tsc-watch@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/tsc-watch/-/tsc-watch-4.4.0.tgz#3ebbf1db54bcef6bfe534b330fa87284a4139320" + integrity sha512-+0Yey6ptOOXAnt44OKTk2/EnQnmA0auL7VWXm9d9abMS4tabt0Xdr9B4AK6OJbWAre9ZdLA81+Nk8sz9unptyA== + dependencies: + cross-spawn "^7.0.3" + node-cleanup "^2.1.2" + ps-tree "^1.2.0" + string-argv "^0.1.1" + strip-ansi "^6.0.0" + + tslib@^1.10.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + + tslib@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" + integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== + + typescript-transpile-only@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/typescript-transpile-only/-/typescript-transpile-only-0.0.4.tgz#d52a9a5587d26272c29cb867b1ba4ab1323d77fb" + integrity sha512-iRNrUzeUZPra6lwEiHwobrKS77Lc3W6/dlngW2G4FA1SWuSyrc1LiZtsHcS4JQO7L/3oiiMbouXr1UPZtWroag== + dependencies: + tslib "^1.9.3" + + typescript@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" + integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== + + whatwg-fetch@^3.4.1: + version "3.6.2" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" + integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== + + which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + + wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + + zen-observable@^0.8.14: + version "0.8.15" + resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" + integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== diff --git a/yarn.lock b/yarn.lock index ae0723a..bbbad65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,11 +21,237 @@ tslib "^1.10.0" zen-observable "^0.8.14" +"@babel/code-frame@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== + dependencies: + "@babel/highlight" "^7.14.5" + +"@babel/compat-data@^7.14.5": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08" + integrity sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw== + +"@babel/core@^7.0.0": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab" + integrity sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.14.5" + "@babel/helper-compilation-targets" "^7.14.5" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helpers" "^7.14.6" + "@babel/parser" "^7.14.6" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + +"@babel/generator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.5.tgz#848d7b9f031caca9d0cd0af01b063f226f52d785" + integrity sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA== + dependencies: + "@babel/types" "^7.14.5" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/helper-compilation-targets@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz#7a99c5d0967911e972fe2c3411f7d5b498498ecf" + integrity sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw== + dependencies: + "@babel/compat-data" "^7.14.5" + "@babel/helper-validator-option" "^7.14.5" + browserslist "^4.16.6" + semver "^6.3.0" + +"@babel/helper-function-name@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" + integrity sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ== + dependencies: + "@babel/helper-get-function-arity" "^7.14.5" + "@babel/template" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helper-get-function-arity@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" + integrity sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-hoist-variables@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" + integrity sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-member-expression-to-functions@^7.14.5": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz#97e56244beb94211fe277bd818e3a329c66f7970" + integrity sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-module-imports@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" + integrity sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-module-transforms@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz#7de42f10d789b423eb902ebd24031ca77cb1e10e" + integrity sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA== + dependencies: + "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-simple-access" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/helper-validator-identifier" "^7.14.5" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helper-optimise-call-expression@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c" + integrity sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-replace-supers@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz#0ecc0b03c41cd567b4024ea016134c28414abb94" + integrity sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.14.5" + "@babel/helper-optimise-call-expression" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helper-simple-access@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz#66ea85cf53ba0b4e588ba77fc813f53abcaa41c4" + integrity sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-split-export-declaration@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" + integrity sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-validator-identifier@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" + integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== + +"@babel/helper-validator-option@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + +"@babel/helpers@^7.14.6": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.6.tgz#5b58306b95f1b47e2a0199434fa8658fa6c21635" + integrity sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA== + dependencies: + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/highlight@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" + integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== + +"@babel/runtime@^7.0.0": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" + integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== + dependencies: + regenerator-runtime "^0.13.4" + +"@babel/template@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" + integrity sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/traverse@^7.14.5": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753" + integrity sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.14.5" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-hoist-variables" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/parser" "^7.14.7" + "@babel/types" "^7.14.5" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff" + integrity sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" + to-fast-properties "^2.0.0" + "@graphql-typed-document-node/core@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950" integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg== +"@tsconfig/node10@^1.0.7": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" + integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + +"@tsconfig/node12@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" + integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + +"@tsconfig/node14@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" + integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + +"@tsconfig/node16@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.1.tgz#a6ca6a9a0ff366af433f42f5f0e124794ff6b8f1" + integrity sha512-FTgBI767POY/lKNDNbIzgAX6miIDBs6NTCbdlDb8TrWovHsSvaVIZDlTqym29C6UqhzwcJx4CYr+AlrMywA0cA== + "@types/graphql@^14.5.0": version "14.5.0" resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-14.5.0.tgz#a545fb3bc8013a3547cf2f07f5e13a33642b75d6" @@ -38,6 +264,16 @@ resolved "https://registry.yarnpkg.com/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.35.tgz#c1c0d402daac324582b6186b91f8905340ea3361" integrity sha512-DaZNUvLDCAnCTjgwxgiL1eQdxIKEpNLOlTNtAgnZc50bG2copGhRrFN9/PxPBuJe+tZVLCbQ7ls0xveXVRPkvw== +"@types/jasmine-ajax@^3.3.3": + version "3.3.3" + resolved "https://registry.yarnpkg.com/@types/jasmine-ajax/-/jasmine-ajax-3.3.3.tgz#ec89515434d4aee9772e25a730bd626ecf44260d" + integrity sha512-e2iJYrdwfxr6WmLHxNjISUgbrbGaRsFHsc9xnrq8SGFzbSYPDZ4lmAkIulAAjqrkZ1z21OJCZsZwWMnxoeX7+A== + +"@types/jasmine@^3.8.1": + version "3.8.1" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.8.1.tgz#8feebf4035d1e4c6a6ed4d27f3bbd285d8d0da91" + integrity sha512-ioRNoJvv0eXL1c9BZKpnywZWb5YflhaSiF3IOp9deyoh30MOwkB3bNuzi4UW76EFEhcmqpoEpdWhcUAAilomTw== + "@types/lodash@^4.14.170": version "4.14.170" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.170.tgz#0d67711d4bf7f4ca5147e9091b847479b87925d6" @@ -93,6 +329,128 @@ ansi-regex@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +browserslist@^4.16.6: + version "4.16.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" + integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== + dependencies: + caniuse-lite "^1.0.30001219" + colorette "^1.2.2" + electron-to-chromium "^1.3.723" + escalade "^3.1.1" + node-releases "^1.1.71" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +caniuse-lite@^1.0.30001219: + version "1.0.30001244" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001244.tgz#a6dc49ad5fa02d81d04373ec3f5ceabc3da06abf" + integrity sha512-Wb4UFZPkPoJoKKVfELPWytRzpemjP/s0pe22NriANru1NoI+5bGNxzKtk7edYL8rmCWTfQO8eRiF0pn1Dqzx7Q== + +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colorette@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.7.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== + dependencies: + safe-buffer "~5.1.1" + +core-js@^3.0.0: + version "3.15.2" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.15.2.tgz#740660d2ff55ef34ce664d7e2455119c5bdd3d61" + integrity sha512-tKs41J7NJVuaya8DxIOCnl8QuPHx5/ZVbFo1oKgVl1qHFBBrDctzQGtuLjPpRdNTWmKPH6oEvgN/MUID+l485Q== + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -107,11 +465,43 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== +debug@^4.1.0, debug@^4.1.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + duplexer@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== +electron-to-chromium@^1.3.723: + version "1.3.774" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.774.tgz#4d6661a23119e35151646c9543b346bb3beca423" + integrity sha512-Fggh17Q1yyv1uMzq8Qn1Ci58P50qcRXMXd2MBcB9sxo6rJxjUutWcNw8uCm3gFWMdcblBO6mDT5HzX/RVRRECA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + event-stream@=3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" @@ -130,11 +520,64 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fetch-mock@^9.11.0: + version "9.11.0" + resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-9.11.0.tgz#371c6fb7d45584d2ae4a18ee6824e7ad4b637a3f" + integrity sha512-PG1XUv+x7iag5p/iNHD4/jdpxL9FtVSqRMUQhPab4hVDt80T1MH5ehzVrL2IdXO9Q2iBggArFvPqjUbHFuI58Q== + dependencies: + "@babel/core" "^7.0.0" + "@babel/runtime" "^7.0.0" + core-js "^3.0.0" + debug "^4.1.1" + glob-to-regexp "^0.4.0" + is-subset "^0.1.1" + lodash.isequal "^4.5.0" + path-to-regexp "^2.2.1" + querystring "^0.2.0" + whatwg-url "^6.5.0" + from@~0: version "0.1.7" resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +glob-to-regexp@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + +glob@^7.1.6: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + graphql-tag@^2.12.0: version "2.12.5" resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.5.tgz#5cff974a67b417747d05c8d9f5f3cb4495d0db8f" @@ -147,6 +590,11 @@ graphql@*: resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" integrity sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw== +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" @@ -154,6 +602,29 @@ hoist-non-react-statics@^3.3.2: dependencies: react-is "^16.7.0" +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -167,16 +638,63 @@ isomorphic-fetch@^3.0.0: node-fetch "^2.6.1" whatwg-fetch "^3.4.1" +jasmine-ajax@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jasmine-ajax/-/jasmine-ajax-4.0.0.tgz#7d8ba7e47e3f7e780e155fe9aa563faafa7e1a26" + integrity sha512-htTxNw38BSHxxmd8RRMejocdPqLalGHU6n3HWFbzp/S8AuTQd1MYjkSH3dYDsbZ7EV1Xqx/b94m3tKaVSVBV2A== + +jasmine-core@~3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.8.0.tgz#815399aae5aa5d9beeb1262805f981b99ffc9bf0" + integrity sha512-zl0nZWDrmbCiKns0NcjkFGYkVTGCPUgoHypTaj+G2AzaWus7QGoXARSlYsSle2VRpSdfJmM+hzmFKzQNhF2kHg== + +jasmine-ts@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/jasmine-ts/-/jasmine-ts-0.4.0.tgz#b228c450cb70471344ce154c0e47d2f588f4a479" + integrity sha512-bIAWJKUwxfuZfGI1ctEbny7+dsyFzsN0eLzOokxh0qIUCofai2WUEKoe3MMllkGEBXJzbEVYr2IyhJBv4j7SBA== + dependencies: + yargs "^17.0.1" + +jasmine@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.8.0.tgz#4497bc797eede7ca9de18179aedd4cf50245d8dc" + integrity sha512-kdQ3SfcNpMbbMdgJPLyFe9IksixdnrgYaCJapP9sS0aLgdWdIZADNXEr+11Zafxm1VDfRSC5ZL4fzXT0bexzXw== + dependencies: + glob "^7.1.6" + jasmine-core "~3.8.0" + jquery@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== -"js-tokens@^3.0.0 || ^4.0.0": +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json5@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -189,11 +707,33 @@ loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + node-cleanup@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/node-cleanup/-/node-cleanup-2.1.2.tgz#7ac19abd297e09a7f72a71545d951b517e4dde2c" @@ -204,11 +744,23 @@ node-fetch@^2.6.1: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-releases@^1.1.71: + version "1.1.73" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20" + integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg== + object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + optimism@^0.16.0: version "0.16.1" resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.1.tgz#7c8efc1f3179f18307b887e18c15c5b7133f6e7d" @@ -217,11 +769,21 @@ optimism@^0.16.0: "@wry/context" "^0.6.0" "@wry/trie" "^0.3.0" +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== +path-to-regexp@^2.2.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" + integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== + pause-stream@0.0.11: version "0.0.11" resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" @@ -245,6 +807,16 @@ ps-tree@^1.2.0: dependencies: event-stream "=3.3.4" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +querystring@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" + integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== + react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -258,6 +830,26 @@ react@^17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" +regenerator-runtime@^0.13.4: + version "0.13.7" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" + integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -270,6 +862,24 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +source-map-support@^0.5.17: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + split@0.3: version "0.3.3" resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" @@ -289,6 +899,15 @@ string-argv@^0.1.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.1.2.tgz#c5b7bc03fb2b11983ba3a72333dd0559e77e4738" integrity sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA== +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" @@ -296,6 +915,13 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + symbol-observable@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205" @@ -306,6 +932,18 @@ through@2, through@~2.3, through@~2.3.1: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + dependencies: + punycode "^2.1.0" + ts-invariant@^0.7.0: version "0.7.5" resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.7.5.tgz#f9658719f9a7737b117d09820d952aacf6263f9c" @@ -313,6 +951,22 @@ ts-invariant@^0.7.0: dependencies: tslib "^2.1.0" +ts-node@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.1.0.tgz#e656d8ad3b61106938a867f69c39a8ba6efc966e" + integrity sha512-6szn3+J9WyG2hE+5W8e0ruZrzyk1uFLYye6IGMBadnOzDh8aP7t8CbFpsfCiEx2+wMixAhjFt7lOZC4+l+WbEA== + dependencies: + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + tsc-watch@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/tsc-watch/-/tsc-watch-4.4.0.tgz#3ebbf1db54bcef6bfe534b330fa87284a4139320" @@ -346,11 +1000,25 @@ typescript@^4.3.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + whatwg-fetch@^3.4.1: version "3.6.2" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== +whatwg-url@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -358,6 +1026,48 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs@^17.0.1: + version "17.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb" + integrity sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + zen-observable@^0.8.14: version "0.8.15" resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" From 8ca6b577f5284e3a65cde08d21ade4feb2d5a380 Mon Sep 17 00:00:00 2001 From: waseemanwar1 Date: Fri, 16 Jul 2021 23:18:42 +0500 Subject: [PATCH 15/15] Added spec for get --- spec/StoreSpec.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 spec/StoreSpec.ts diff --git a/spec/StoreSpec.ts b/spec/StoreSpec.ts new file mode 100644 index 0000000..b6910c5 --- /dev/null +++ b/spec/StoreSpec.ts @@ -0,0 +1,9 @@ +import Store from '../src/store'; + +describe('store test', () => { + + it('should not null', () =>{ + expect(Store.get).not.toBeNull(); + }) + +});