From 5627da20f09ca73cb8768449565b2561195603f1 Mon Sep 17 00:00:00 2001 From: gabrielburnworth Date: Fri, 5 Apr 2024 13:58:31 -0700 Subject: [PATCH] upgrade deps --- Gemfile.lock | 10 +++---- frontend/demo/demo_iframe.tsx | 4 +-- frontend/terminal/terminal_session.ts | 4 +-- .../__tests__/try_farmbot_test.tsx | 7 +++++ lib/tasks/fe.rake | 5 ---- package.json | 26 +++++++++---------- 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index feb3333f68..3f11d71e26 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -123,7 +123,7 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faker (3.3.0) + faker (3.3.1) i18n (>= 1.8.11, < 2) faraday (1.10.3) faraday-em_http (~> 1.0) @@ -253,7 +253,7 @@ GEM method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (5.0.4) + public_suffix (5.0.5) rabbitmq_http_api_client (2.2.0) addressable (~> 2.7) faraday (~> 1.3) @@ -301,7 +301,7 @@ GEM method_source rake (>= 12.2) thor (~> 1.0) - rake (13.1.0) + rake (13.2.1) rbtree (0.4.6) redis (4.8.1) representable (3.2.0) @@ -340,10 +340,10 @@ GEM rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) ruby2_keywords (0.0.5) - scenic (1.7.0) + scenic (1.8.0) activerecord (>= 4.0.0) railties (>= 4.0.0) - scout_apm (5.3.7) + scout_apm (5.3.8) parser secure_headers (6.5.0) set (1.1.0) diff --git a/frontend/demo/demo_iframe.tsx b/frontend/demo/demo_iframe.tsx index 21f5009809..e11e362391 100644 --- a/frontend/demo/demo_iframe.tsx +++ b/frontend/demo/demo_iframe.tsx @@ -1,4 +1,4 @@ -import { ClientSubscribeCallback, connect, IConnackPacket } from "mqtt"; +import mqtt, { ClientSubscribeCallback, IConnackPacket } from "mqtt"; import React from "react"; import { uuid } from "farmbot"; import axios from "axios"; @@ -37,7 +37,7 @@ export class DemoIframe extends React.Component<{}, State> { setError = (error?: Error) => this.setState({ error }); connectMqtt = (): Promise => { - const client = connect(globalConfig.MQTT_WS, WS_CONFIG); + const client = mqtt.connect(globalConfig.MQTT_WS, WS_CONFIG); return new Promise(resolve => { client.on("message", this.handleMessage); client.subscribe(MQTT_CHAN, this.setError as ClientSubscribeCallback); diff --git a/frontend/terminal/terminal_session.ts b/frontend/terminal/terminal_session.ts index 5e60894f10..199a13198b 100644 --- a/frontend/terminal/terminal_session.ts +++ b/frontend/terminal/terminal_session.ts @@ -1,5 +1,5 @@ import { times } from "lodash"; -import { connect, MqttClient } from "mqtt"; +import mqtt, { MqttClient } from "mqtt"; import { Terminal } from "xterm"; type TerminalLike = Pick; @@ -17,7 +17,7 @@ export class TerminalSession { constructor(url: string, public username: string, password: string, private terminal: TerminalLike) { - this.client = connect(url, { username, password }); + this.client = mqtt.connect(url, { username, password }); } get rx() { return `bot/${this.username}/terminal_output`; } diff --git a/frontend/try_farmbot/__tests__/try_farmbot_test.tsx b/frontend/try_farmbot/__tests__/try_farmbot_test.tsx index 71bb8652b3..095a8b0caf 100644 --- a/frontend/try_farmbot/__tests__/try_farmbot_test.tsx +++ b/frontend/try_farmbot/__tests__/try_farmbot_test.tsx @@ -1,3 +1,10 @@ +jest.mock("mqtt", () => ({ + connect: () => ({ + on: jest.fn(), + subscribe: jest.fn(), + }) +})); + import React from "react"; import { shallow } from "enzyme"; import { DEMO_LOADING, TryFarmbot } from "../try_farmbot"; diff --git a/lib/tasks/fe.rake b/lib/tasks/fe.rake index 83fbf458f1..e8752ce4e2 100644 --- a/lib/tasks/fe.rake +++ b/lib/tasks/fe.rake @@ -12,11 +12,6 @@ EXCLUDE = [ reason: "dependency needs", version: "1.4.1", }, - { - packages: ["mqtt"], - reason: "import error", - version: "5.3.0", - }, ] # Load package.json as JSON. diff --git a/package.json b/package.json index 5ac73c7ce8..64c4faf917 100644 --- a/package.json +++ b/package.json @@ -38,16 +38,16 @@ "@monaco-editor/react": "4.6.0", "@parcel/transformer-sass": "2.12.0", "@parcel/transformer-typescript-tsc": "2.12.0", - "@react-three/drei": "9.102.6", - "@react-three/fiber": "8.16.0", + "@react-three/drei": "9.105.1", + "@react-three/fiber": "8.16.1", "@types/lodash": "4.17.0", "@types/markdown-it": "13.0.7", - "@types/node": "20.11.30", + "@types/node": "20.12.4", "@types/promise-timeout": "1.3.3", - "@types/react": "18.2.73", + "@types/react": "18.2.74", "@types/react-color": "3.0.12", - "@types/react-dom": "18.2.22", - "@types/three": "0.162.0", + "@types/react-dom": "18.2.24", + "@types/three": "0.163.0", "@types/ws": "8.5.10", "axios": "1.6.8", "bowser": "2.11.0", @@ -60,8 +60,8 @@ "markdown-it-emoji": "3.0.0", "moment": "2.30.1", "monaco-editor": "0.47.0", - "mqtt": "5.1.4", - "npm": "10.5.0", + "mqtt": "5.5.0", + "npm": "10.5.1", "parcel": "2.12.0", "process": "0.11.10", "promise-timeout": "1.3.0", @@ -75,8 +75,8 @@ "redux-immutable-state-invariant": "2.1.0", "redux-thunk": "3.1.0", "takeme": "0.12.0", - "three": "0.162.0", - "typescript": "5.4.3", + "three": "0.163.0", + "typescript": "5.4.4", "url": "0.11.3", "xterm": "5.3.0" }, @@ -84,8 +84,8 @@ "@types/enzyme": "3.10.12", "@types/jest": "29.5.12", "@types/readable-stream": "4.0.11", - "@typescript-eslint/eslint-plugin": "7.4.0", - "@typescript-eslint/parser": "7.4.0", + "@typescript-eslint/eslint-plugin": "7.5.0", + "@typescript-eslint/parser": "7.5.0", "@wojtekmaj/enzyme-adapter-react-17": "0.8.0", "enzyme": "3.11.0", "eslint": "8.57.0", @@ -107,7 +107,7 @@ "raf": "3.4.1", "react-addons-test-utils": "15.6.2", "react-test-renderer": "18.2.0", - "sass": "1.72.0", + "sass": "1.74.1", "sass-lint": "1.13.1", "ts-jest": "29.1.2", "tslint": "6.1.3"