From 189d5abe27304b4e4fa7aa44c8b75990c10fe849 Mon Sep 17 00:00:00 2001 From: Riccardo Graziosi <31478034+riggraz@users.noreply.github.com> Date: Sat, 20 May 2023 12:52:19 +0200 Subject: [PATCH] Remove unused dependencies (#228) * Remove unused package.json dependencies * Remove unused files * Remove some bootstrap js dependencies --- .../stylesheets/vendors/bootstrap_custom.scss | 11 ----- app/channels/application_cable/channel.rb | 4 -- app/channels/application_cable/connection.rb | 4 -- app/javascript/application.js | 11 ++--- app/javascript/channels/consumer.js | 6 --- app/javascript/channels/index.js | 5 --- app/javascript/translations/index.js.erb | 2 + app/jobs/application_job.rb | 7 --- package.json | 21 ++++----- yarn.lock | 45 ++++--------------- 10 files changed, 23 insertions(+), 93 deletions(-) delete mode 100644 app/channels/application_cable/channel.rb delete mode 100644 app/channels/application_cable/connection.rb delete mode 100644 app/javascript/channels/consumer.js delete mode 100644 app/javascript/channels/index.js delete mode 100644 app/jobs/application_job.rb diff --git a/app/assets/stylesheets/vendors/bootstrap_custom.scss b/app/assets/stylesheets/vendors/bootstrap_custom.scss index c81cd71e..46fcd828 100644 --- a/app/assets/stylesheets/vendors/bootstrap_custom.scss +++ b/app/assets/stylesheets/vendors/bootstrap_custom.scss @@ -6,12 +6,9 @@ @import 'bootstrap/scss/_type.scss'; @import 'bootstrap/scss/_alert.scss'; @import 'bootstrap/scss/_badge'; -@import 'bootstrap/scss/_breadcrumb'; -@import 'bootstrap/scss/_button-group'; @import 'bootstrap/scss/_buttons'; @import 'bootstrap/scss/_buttons.scss'; @import 'bootstrap/scss/_card.scss'; -@import 'bootstrap/scss/_carousel.scss'; @import 'bootstrap/scss/_close.scss'; @import 'bootstrap/scss/_code.scss'; @import 'bootstrap/scss/_custom-forms.scss'; @@ -20,19 +17,11 @@ @import 'bootstrap/scss/_grid.scss'; @import 'bootstrap/scss/_images.scss'; @import 'bootstrap/scss/_input-group.scss'; -@import 'bootstrap/scss/_jumbotron.scss'; @import 'bootstrap/scss/_list-group.scss'; -@import 'bootstrap/scss/_media.scss'; -@import 'bootstrap/scss/_modal.scss'; @import 'bootstrap/scss/_nav.scss'; @import 'bootstrap/scss/_navbar.scss'; -@import 'bootstrap/scss/_pagination.scss'; -@import 'bootstrap/scss/_popover.scss'; @import 'bootstrap/scss/_print.scss'; @import 'bootstrap/scss/_progress.scss'; @import 'bootstrap/scss/_spinners.scss'; @import 'bootstrap/scss/_tables.scss'; -@import 'bootstrap/scss/_toasts.scss'; -@import 'bootstrap/scss/_tooltip.scss'; -@import 'bootstrap/scss/_transitions.scss'; @import 'bootstrap/scss/_utilities.scss'; \ No newline at end of file diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb deleted file mode 100644 index d6726972..00000000 --- a/app/channels/application_cable/channel.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Channel < ActionCable::Channel::Base - end -end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb deleted file mode 100644 index 0ff5442f..00000000 --- a/app/channels/application_cable/connection.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Connection < ActionCable::Connection::Base - end -end diff --git a/app/javascript/application.js b/app/javascript/application.js index a41b70eb..4097f4da 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,19 +1,16 @@ // Entry point for the build script in your package.json // turbolinks -require("turbolinks").start(); +require('turbolinks').start(); // react-rails -var componentRequireContext = require.context("./components", true); -var ReactRailsUJS = require("react_ujs"); +var componentRequireContext = require.context('./components', true); +var ReactRailsUJS = require('react_ujs'); ReactRailsUJS.useContext(componentRequireContext); // bootstrap (js only) -require('bootstrap/js/dist/alert'); -require('bootstrap/js/dist/button'); -require('bootstrap/js/dist/collapse'); -require('bootstrap/js/dist/dropdown'); require('bootstrap/js/dist/util'); +require('bootstrap/js/dist/dropdown'); // i18n-js translations require('./translations/index.js.erb'); \ No newline at end of file diff --git a/app/javascript/channels/consumer.js b/app/javascript/channels/consumer.js deleted file mode 100644 index 0eceb59b..00000000 --- a/app/javascript/channels/consumer.js +++ /dev/null @@ -1,6 +0,0 @@ -// Action Cable provides the framework to deal with WebSockets in Rails. -// You can generate new channels where WebSocket features live using the `rails generate channel` command. - -import { createConsumer } from "@rails/actioncable" - -export default createConsumer() diff --git a/app/javascript/channels/index.js b/app/javascript/channels/index.js deleted file mode 100644 index 0cfcf749..00000000 --- a/app/javascript/channels/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// Load all the channels within this directory and all subdirectories. -// Channel files must be named *_channel.js. - -const channels = require.context('.', true, /_channel\.js$/) -channels.keys().forEach(channels) diff --git a/app/javascript/translations/index.js.erb b/app/javascript/translations/index.js.erb index 758996ef..8e918221 100644 --- a/app/javascript/translations/index.js.erb +++ b/app/javascript/translations/index.js.erb @@ -1,4 +1,6 @@ import I18n from "i18n-js" + I18n.translations = <%= I18n::JS.filtered_translations.to_json %> I18n.locale = LOCALE + export default I18n \ No newline at end of file diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb deleted file mode 100644 index d394c3d1..00000000 --- a/app/jobs/application_job.rb +++ /dev/null @@ -1,7 +0,0 @@ -class ApplicationJob < ActiveJob::Base - # Automatically retry jobs that encountered a deadlock - # retry_on ActiveRecord::Deadlocked - - # Most jobs are safe to ignore if the underlying records are no longer available - # discard_on ActiveJob::DeserializationError -end diff --git a/package.json b/package.json index a8d2b167..4980982b 100644 --- a/package.json +++ b/package.json @@ -14,22 +14,17 @@ ] }, "dependencies": { - "@babel/core": "^7.21.8", - "@babel/preset-env": "^7.21.5", - "@babel/preset-react": "^7.18.6", - "@babel/preset-typescript": "^7.21.5", - "@rails/actioncable": "6.1.7-3", - "@rails/activestorage": "6.1.7-3", - "@rails/ujs": "6.1.7-3", + "@babel/core": "7.21.8", + "@babel/preset-env": "7.21.5", + "@babel/preset-react": "7.18.6", + "@babel/preset-typescript": "7.21.5", "@types/react": "16.9.2", "@types/react-dom": "16.9.0", - "babel-loader": "^9.1.2", - "babel-plugin-transform-react-remove-prop-types": "0.4.24", + "babel-loader": "9.1.2", "bootstrap": "4.6.2", "i18n-js": "3.9.2", "jquery": "3.5.1", "popper.js": "1.16.1", - "prop-types": "15.7.2", "rails-erb-loader": "5.5.2", "react": "16.9.0", "react-beautiful-dnd": "13.1.0", @@ -43,11 +38,11 @@ "react_ujs": "2.6.0", "redux": "4.0.4", "redux-thunk": "2.3.0", - "sass": "^1.62.1", + "sass": "1.62.1", "turbolinks": "5.2.0", "typescript": "4.3.2", - "webpack": "^5.82.1", - "webpack-cli": "^5.1.1" + "webpack": "5.82.1", + "webpack-cli": "5.1.1" }, "devDependencies": { "@types/react-redux": "7.1.3" diff --git a/yarn.lock b/yarn.lock index 242a1f2e..b9be644e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,7 +22,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.7.tgz#61caffb60776e49a57ba61a88f02bedd8714f6bc" integrity sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA== -"@babel/core@^7.21.8": +"@babel/core@7.21.8": version "7.21.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.8.tgz#2a8c7f0f53d60100ba4c32470ba0281c92aa9aa4" integrity sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ== @@ -835,7 +835,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/preset-env@^7.21.5": +"@babel/preset-env@7.21.5": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.21.5.tgz#db2089d99efd2297716f018aeead815ac3decffb" integrity sha512-wH00QnTTldTbf/IefEVyChtRdw5RJvODT/Vb4Vcxq1AZvtXj6T0YeX0cAcXhI6/BdGuiP3GcNIL4OQbI2DVNxg== @@ -928,7 +928,7 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@^7.18.6": +"@babel/preset-react@7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.18.6.tgz#979f76d6277048dc19094c217b507f3ad517dd2d" integrity sha512-zXr6atUmyYdiWRVLOZahakYmOBHtWc2WGCkP8PYTgZi0iJXDY2CN180TdrIW4OGOAdLc7TifzDIvtx6izaRIzg== @@ -940,7 +940,7 @@ "@babel/plugin-transform-react-jsx-development" "^7.18.6" "@babel/plugin-transform-react-pure-annotations" "^7.18.6" -"@babel/preset-typescript@^7.21.5": +"@babel/preset-typescript@7.21.5": version "7.21.5" resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.21.5.tgz#68292c884b0e26070b4d66b202072d391358395f" integrity sha512-iqe3sETat5EOrORXiQ6rWfoOg2y68Cs75B9wNxdPW4kixJxh7aXQE1KPdWLDniC24T/6dSnguF33W9j/ZZQcmA== @@ -1061,23 +1061,6 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@rails/actioncable@6.1.7-3": - version "6.1.7-3" - resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-6.1.7-3.tgz#248a5df81452e619b14ebf913dac43fa21710894" - integrity sha512-I4ynPaxiHixbd6k2/Yr1rndfSigu80YS8SaPnxJVbS7ssG9qqe5fkv6ilRIuVfLui/aZJoAF1p3HHClx0drGkA== - -"@rails/activestorage@6.1.7-3": - version "6.1.7-3" - resolved "https://registry.yarnpkg.com/@rails/activestorage/-/activestorage-6.1.7-3.tgz#d81baf094ff0509bfd4b8b7ba940b3b759bb79e6" - integrity sha512-dsdU5pzmdENYmje4WW9AQkmnDro3sCnzg+h0/L0JqXvi+hml5+eq/6A+ZAzLWoIE6C2m2+wLZt0C6p78BBjp/Q== - dependencies: - spark-md5 "^3.0.0" - -"@rails/ujs@6.1.7-3": - version "6.1.7-3" - resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-6.1.7-3.tgz#98aac31a893044f81c11a3f993d2a68bca7c69d5" - integrity sha512-KYctG8imKz3OxpjN4wfuDhJkbs5QPAA7kRmhNosvfUyLiqJRrNN+oNmOyErGM7Bc89nm2zhdZz4TwIDAqMsluQ== - "@types/eslint-scope@^3.7.3": version "3.7.4" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" @@ -1387,7 +1370,7 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -babel-loader@^9.1.2: +babel-loader@9.1.2: version "9.1.2" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.1.2.tgz#a16a080de52d08854ee14570469905a5fc00d39c" integrity sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA== @@ -1419,11 +1402,6 @@ babel-plugin-polyfill-regenerator@^0.4.1: dependencies: "@babel/helper-define-polyfill-provider" "^0.3.3" -babel-plugin-transform-react-remove-prop-types@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" - integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA== - bail@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" @@ -2262,7 +2240,7 @@ popper.js@1.16.1: resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== -prop-types@15.7.2, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.5.8, prop-types@^15.6.2, 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== @@ -2547,7 +2525,7 @@ safe-buffer@^5.1.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -sass@^1.62.1: +sass@1.62.1: version "1.62.1" resolved "https://registry.yarnpkg.com/sass/-/sass-1.62.1.tgz#caa8d6bf098935bc92fc73fa169fb3790cacd029" integrity sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A== @@ -2632,11 +2610,6 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -spark-md5@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.0.tgz#3722227c54e2faf24b1dc6d933cc144e6f71bfef" - integrity sha1-NyIifFTi+vJLHcbZM8wUTm9xv+8= - strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" @@ -2844,7 +2817,7 @@ watchpack@^2.4.0: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" -webpack-cli@^5.1.1: +webpack-cli@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.1.tgz#c211ac6d911e77c512978f7132f0d735d4a97ace" integrity sha512-OLJwVMoXnXYH2ncNGU8gxVpUtm3ybvdioiTvHgUyBuyMLKiVvWy+QObzBsMtp5pH7qQoEuWgeEUQ/sU3ZJFzAw== @@ -2876,7 +2849,7 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.82.1: +webpack@5.82.1: version "5.82.1" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.82.1.tgz#8f38c78e53467556e8a89054ebd3ef6e9f67dbab" integrity sha512-C6uiGQJ+Gt4RyHXXYt+v9f+SN1v83x68URwgxNQ98cvH8kxiuywWGP4XeNZ1paOzZ63aY3cTciCEQJNFUljlLw==