Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend audit #1040

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .husky/helpers/neeto_audit_frontend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

neeto_audit_frontend() {
npx neeto-audit-frontend
}
2 changes: 0 additions & 2 deletions .husky/helpers/prevent_pushing_to_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ prevent_pushing_to_main() {
======================================================================================
You are not authorized to push/commit directly to master/main branch in origin remote.
Push from a new branch and make the PR.

Or if you are 100% sure you want to push/commit to master/main branch,
then pass in the optional --no-verify option with the git command.

Example:
# Warning: pushing to main is not recommended
git push origin main --no-verify
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/helpers/prevent_pushing_to_main.sh"
. "$(dirname "$0")/helpers/neeto_audit_frontend.sh"

prevent_pushing_to_main
neeto_audit_frontend
17 changes: 16 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
module.exports = require("@bigbinary/neeto-commons-frontend/configs/prettier.js");
module.exports = {
tailwindConfig: "./tailwind.config.js",
trailingComma: "es5",
arrowParens: "avoid",
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: true,
quoteProps: "as-needed",
jsxSingleQuote: false,
singleQuote: false,
bracketSpacing: true,
bracketSameLine: false,
proseWrap: "always",
endOfLine: "lf",
};
146 changes: 79 additions & 67 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,28 @@
"@babel/core": "^7.19.1",
"@babel/eslint-parser": "7.17.0",
"@babel/plugin-transform-runtime": "^7.19.1",
"@babel/preset-env": "7.17.10",
"@babel/preset-react": "7.16.7",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.19.0",
"@bigbinary/babel-preset-neeto": "^1.0.4",
"@bigbinary/eslint-plugin-neeto": "^1.0.54",
"@bigbinary/neeto-audit-frontend": "2.0.1",
"@bigbinary/neeto-cist": "^1.0.2",
"@bigbinary/neeto-commons-frontend": "^2.1.29",
"@bigbinary/neeto-icons": "1.11.0",
"@bigbinary/neeto-molecules": "^1.0.94",
"@bigbinary/neetoui": "4.4.0",
"@honeybadger-io/react": "2.0.1",
"@rollup/plugin-alias": "3.1.9",
"@rollup/plugin-babel": "5.3.1",
"@rollup/plugin-commonjs": "22.0.2",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@rollup/plugin-replace": "4.0.0",
"@babel/preset-env": "7.23.2",
"@babel/preset-react": "7.22.15",
"@babel/preset-typescript": "7.23.2",
"@babel/runtime": "7.23.2",
"@bigbinary/babel-preset-neeto": "1.0.6",
"@bigbinary/eslint-plugin-neeto": "1.5.0",
"@bigbinary/neeto-audit-frontend": "^2.0.9",
"@bigbinary/neeto-cist": "1.0.9",
"@bigbinary/neeto-commons-frontend": "3.2.4",
"@bigbinary/neeto-filters-frontend": "3.2.8",
"@bigbinary/neeto-icons": "1.18.0",
"@bigbinary/neeto-molecules": "1.13.8",
"@bigbinary/neetoui": "6.3.8",
"@faker-js/faker": "8.2.0",
"@honeybadger-io/js": "6.5.3",
"@honeybadger-io/react": "6.1.9",
"@rollup/plugin-alias": "5.0.1",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-json": "6.0.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-replace": "5.0.4",
"@storybook/addon-actions": "6.5.16",
"@storybook/addon-docs": "6.5.16",
"@storybook/addon-essentials": "6.5.16",
Expand All @@ -57,7 +60,7 @@
"@storybook/preset-scss": "1.0.3",
"@storybook/react": "6.5.16",
"@storybook/testing-library": "0.0.13",
"@svgr/rollup": "6.3.1",
"@svgr/rollup": "8.1.0",
"@tippyjs/react": "4.2.6",
"@tiptap/extension-bubble-menu": "2.0.0-beta.199",
"@tiptap/extension-character-count": "2.0.0-beta.199",
Expand All @@ -84,107 +87,116 @@
"@uppy/drop-target": "2.0.1",
"@uppy/react": "2.2.2",
"@uppy/url": "2.2.0",
"antd": "4.24.3",
"autoprefixer": "^10.4.5",
"antd": "5.10.2",
"autoprefixer": "10.4.16",
"axios": "1.6.2",
"babel-loader": "^8.2.5",
"babel-plugin-istanbul": "^6.1.1",
"babel-loader": "9.1.3",
"babel-plugin-istanbul": "6.1.1",
"babel-plugin-js-logger": "1.0.17",
"babel-plugin-macros": "3.1.0",
"babel-plugin-preval": "^5.1.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"babel-preset-react": "6.24.1",
"babel-preset-typescript": "^7.0.0-alpha.19",
"classnames": "2.3.1",
"babel-preset-typescript": "7.0.0-alpha.19",
"classnames": "2.3.2",
"crypto-js": "4.1.1",
"css-loader": "6.7.1",
"dompurify": "2.4.0",
"emoji-mart": "5.2.2",
"eslint": "8.14.0",
"eslint": "8.52.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-cypress": "2.15.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jam3": "0.2.3",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.5.0",
"eslint-plugin-unused-imports": "2.0.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-security": "1.7.1",
"eslint-plugin-sonarjs": "0.21.0",
"eslint-plugin-unused-imports": "3.0.0",
"eslint-plugin-xss": "0.1.12",
"express": "^4.18.2",
"formik": "2.2.9",
"formik": "2.4.5",
"fuse.js": "6.6.2",
"husky": "8.0.1",
"i18next": "23.2.7",
"js-logger": "^1.6.1",
"lint-staged": "12.4.1",
"husky": "8.0.3",
"i18next": "23.6.0",
"js-logger": "1.6.1",
"lint-staged": "15.0.2",
"lowlight": "2.7.0",
"postcss": "8.4.14",
"postcss-import": "14.1.0",
"postcss-loader": "4.3.0",
"postcss-preset-env": "7.8.2",
"prettier": "2.6.2",
"prettier-plugin-tailwindcss": "0.1.10",
"ramda": "0.29.0",
"qs": "6.11.2",
"ramda": "0.29.1",
"re-resizable": "6.9.9",
"react": "^18.2.0",
"react": "18.2.0",
"react-colorful": "5.6.1",
"react-doc-viewer": "^0.1.5",
"react-dom": "^18.2.0",
"react-dom": "18.2.0",
"react-file-icon": "^1.3.0",
"react-helmet": "6.1.0",
"react-hotkeys-hook": "3.4.7",
"react-i18next": "13.0.1",
"react-i18next": "13.3.1",
"react-masonry-infinite": "1.2.2",
"react-popper": "2.3.0",
"react-query": "3.39.3",
"react-router-dom": "5.3.3",
"react-toastify": "8.0.2",
"react-router-dom": "5.3.4",
"react-toastify": "8.2.0",
"rollup": "2.79.1",
"rollup-plugin-analyzer": "4.0.0",
"rollup-plugin-cleaner": "1.0.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-styles": "4.0.0",
"sass": "1.55.0",
"sass": "1.69.5",
"sass-loader": "13.0.2",
"storybook-dark-mode": "^2.1.1",
"style-loader": "3.3.1",
"tailwindcss": "^3.4.1",
"tailwindcss": "3.4.1",
"tippy.js": "6.3.7",
"util": "0.12.5",
"webpack": "5.73.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.9.3",
"yup": "0.32.11"
"yup": "1.3.2"
},
"peerDependencies": {
"@bigbinary/babel-preset-neeto": "latest",
"@bigbinary/neeto-cist": "latest",
"@bigbinary/neeto-commons-frontend": "latest",
"@bigbinary/neeto-icons": "latest",
"@bigbinary/neeto-molecules": "latest",
"@bigbinary/neetoui": "latest",
"@honeybadger-io/react": "2.0.1",
"@bigbinary/neeto-commons-frontend": "3.2.4",
"@bigbinary/neeto-filters-frontend": "3.2.8",
"@bigbinary/neeto-icons": "1.18.0",
"@bigbinary/neeto-molecules": "1.13.8",
"@bigbinary/neetoui": "6.3.8",
"@honeybadger-io/js": "^6.5.3",
"@honeybadger-io/react": "^6.1.9",
"antd": "4.24.3",
"axios": "1.6.2",
"formik": "2.2.9",
"i18next": "23.2.7",
"classnames": "^2.3.2",
"formik": "^2.4.5",
"i18next": "^23.6.0",
"js-logger": "^1.6.1",
"ramda": "0.29.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-helmet": "6.1.0",
"react-i18next": "13.0.1",
"react-query": "3.39.3",
"react-router-dom": "5.3.3",
"react-toastify": "8.0.2",
"yup": "0.32.11"
"ramda": "^0.29.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-i18next": "^13.3.1",
"react-query": "^3.39.3",
"react-router-dom": "^5.3.4",
"react-toastify": "^8.2.0",
"yup": "^0.32.11"
},
"scripts": {
"prepare": "husky install",
"storybook": "start-storybook -p 6006",
"bundle": "NODE_ENV=production rollup -c rollup.config.js",
"build": "build-storybook",
"serve": "node .storybook/express"
"bundle": "NODE_ENV=production rollup -c rollup.config.js",
"prepare": "husky install",
"serve": "node .storybook/express",
"storybook": "start-storybook -p 6006"
},
"lint-staged": {
"src/**/*.{js,jsx,json}": [
Expand Down
10 changes: 5 additions & 5 deletions src/utils/ActiveStorageUpload.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
import { BasePlugin } from "@uppy/core";
import { isEmpty } from "ramda";

Expand Down Expand Up @@ -41,11 +42,10 @@ class ActiveStorageUpload extends BasePlugin {
};

this.uppy.on("file-removed", removedFile => {
if (removedFile.id === file.id) {
upload.abort();
if (isEmpty(this.uppy.getFiles())) {
this.uppy.emit("complete");
}
if (!(removedFile.id === file.id)) return;
upload.abort();
if (isEmpty(this.uppy.getFiles())) {
this.uppy.emit("complete");
}
});

Expand Down
Loading