From cf1731b0edbe0fb278032799de91216351aa48fe Mon Sep 17 00:00:00 2001 From: RobertGemmaJr Date: Fri, 5 Apr 2024 16:48:37 -0400 Subject: [PATCH 001/218] build: Upgrade react to latest version --- package-lock.json | 38 +++++++++++++++++++------------------- package.json | 4 ++-- public/electron/main.js | 1 - 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1137c9d66..bfb902d7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,9 +29,9 @@ "jspsych": "^7.2.3", "lodash": "^4.17.19", "prop-types": "^15.8.1", - "react": "^16.8.6", + "react": "^18.2.0", "react-bootstrap": "^1.6.1", - "react-dom": "^16.8.6", + "react-dom": "^18.2.0", "react-scripts": "5.0.1", "serialport": "^12.0.0" }, @@ -23592,12 +23592,11 @@ "optional": true }, "node_modules/react": { - "version": "16.14.0", - "license": "MIT", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2" + "loose-envify": "^1.1.0" }, "engines": { "node": ">=0.10.0" @@ -23790,16 +23789,15 @@ } }, "node_modules/react-dom": { - "version": "16.14.0", - "license": "MIT", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dependencies": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.19.1" + "scheduler": "^0.23.0" }, "peerDependencies": { - "react": "^16.14.0" + "react": "^18.2.0" } }, "node_modules/react-error-overlay": { @@ -23816,7 +23814,8 @@ }, "node_modules/react-overlays": { "version": "5.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.2.1.tgz", + "integrity": "sha512-GLLSOLWr21CqtJn8geSwQfoJufdt3mfdsnIiQswouuQ2MMPns+ihZklxvsTDKD3cR2tF8ELbi5xUsvqVhR6WvA==", "dependencies": { "@babel/runtime": "^7.13.8", "@popperjs/core": "^2.11.6", @@ -23962,7 +23961,8 @@ }, "node_modules/react-transition-group": { "version": "4.4.5", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -24865,11 +24865,11 @@ } }, "node_modules/scheduler": { - "version": "0.19.1", - "license": "MIT", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" } }, "node_modules/schema-utils": { diff --git a/package.json b/package.json index 0035fbe96..0c46c519a 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,9 @@ "jspsych": "^7.2.3", "lodash": "^4.17.19", "prop-types": "^15.8.1", - "react": "^16.8.6", + "react": "^18.2.0", "react-bootstrap": "^1.6.1", - "react-dom": "^16.8.6", + "react-dom": "^18.2.0", "react-scripts": "5.0.1", "serialport": "^12.0.0" }, diff --git a/public/electron/main.js b/public/electron/main.js index 9ed471793..7a3fafdfb 100644 --- a/public/electron/main.js +++ b/public/electron/main.js @@ -13,7 +13,6 @@ const { getPort, sendToPort } = require("./serialPort"); // TODO @RobertGemmaJr: Add serialport's MockBinding for the "Continue Anyway": https://serialport.io/docs/guide-testing // TODO @RobertGemmaJr: Do more testing with the environment variables - are home/clinic being built correctly? - // Early exit when installing on Windows: https://www.electronforge.io/config/makers/squirrel.windows#handling-startup-events if (require("electron-squirrel-startup")) app.quit(); From 0bbb29118041a02e6006483b31f82140ae387505 Mon Sep 17 00:00:00 2001 From: RobertGemmaJr Date: Fri, 5 Apr 2024 17:53:30 -0400 Subject: [PATCH 002/218] wip: Delete psiturk python script --- .eslintignore | 1 - .gitignore | 3 +-- psiturkit/psiturk-it | 34 ---------------------------------- 3 files changed, 1 insertion(+), 37 deletions(-) delete mode 100755 psiturkit/psiturk-it diff --git a/.eslintignore b/.eslintignore index 957e0135c..9a1c55158 100644 --- a/.eslintignore +++ b/.eslintignore @@ -12,7 +12,6 @@ # Autogenerated files /public/lib/* **/participant_responses -psiturkit/*_turk *.log *.log* diff --git a/.gitignore b/.gitignore index 88429f4c5..cd9f23070 100644 --- a/.gitignore +++ b/.gitignore @@ -34,5 +34,4 @@ Brewfile.lock.json # Misc .env -.DS_Store -psiturkit/*_turk \ No newline at end of file +.DS_Store \ No newline at end of file diff --git a/psiturkit/psiturk-it b/psiturkit/psiturk-it deleted file mode 100755 index 940ce0c6b..000000000 --- a/psiturkit/psiturk-it +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -usage () { echo "Usage: [-h] [-p] [-u]" - echo " -h – help" - echo " -p – Psiturk directory path" - echo " -u – Update existing Psiturk Task"; } - - - while getopts p:u option - do - case "${option}" in - p) PSI_PATH=${OPTARG};; - u) - echo "Cleaning up old directory" - rm -rf ${PSI_PATH} - ;; - \?) usage; exit;; - esac - done - - -if [ -z ${PSI_PATH+x} ]; then - echo "Please set the task input and output directories. Use -t for -jsPsych task path and -p for the psiturk output directory. Make sure you have PsiTurk installed." -else - echo "Setting up ${PSI_PATH} PsiTurk project" - psiturk-setup-example - cp -R ../build/static/* psiturk-example/static/ - cp ../build/*.js* psiturk-example/static/ - cp ../build/lib/*.js psiturk-example/static/lib - cp ../build/index.html psiturk-example/templates/exp.html - mv psiturk-example ${PSI_PATH} -fi From a2cac3db52d205235d28770d82471c0cb70f8696 Mon Sep 17 00:00:00 2001 From: RobertGemmaJr Date: Fri, 5 Apr 2024 17:53:43 -0400 Subject: [PATCH 003/218] Ref: delete mini scripts needed by psiturk --- public/index.html | 13 +- public/lib/backbone-min.js | 4 - public/lib/jquery-min.js | 6 - public/lib/psiturk.js | 362 ----------------------------------- public/lib/underscore-min.js | 6 - 5 files changed, 1 insertion(+), 390 deletions(-) delete mode 100644 public/lib/backbone-min.js delete mode 100644 public/lib/jquery-min.js delete mode 100644 public/lib/psiturk.js delete mode 100644 public/lib/underscore-min.js diff --git a/public/index.html b/public/index.html index d9219a614..fd6d92818 100644 --- a/public/index.html +++ b/public/index.html @@ -25,20 +25,9 @@ --> - - - - - - Honeycomb + diff --git a/public/lib/backbone-min.js b/public/lib/backbone-min.js deleted file mode 100644 index 3541019c5..000000000 --- a/public/lib/backbone-min.js +++ /dev/null @@ -1,4 +0,0 @@ -(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.0.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=k[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)return n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var k={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var S=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var $=/\((.*?)\)/g;var T=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(S.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history.trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace($,"(?:$1)?").replace(T,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var P=/^\/+|\/+$/g;var O=/msie [\w.]+/;var C=/\/$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.substr(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({},{root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=O.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(P,"/");if(r&&this._wantsHashChange){this.iframe=a.$('