From 9cedbcf1a72d9f55b2cefad12275a92e7de0881d Mon Sep 17 00:00:00 2001 From: Deep Panchal Date: Fri, 5 Aug 2022 13:39:15 -0500 Subject: [PATCH] --wip-- [skip ci] --- .eslintrc.js | 7 +- .tool-versions | 2 +- public/index.html => index.html | 5 +- package.json | 27 +- src/App.vue | 239 +- src/components/CaseHeader.vue | 7 +- src/components/FormSelect.vue | 2 +- src/components/WorksiteImageSection.vue | 4 +- src/components/__tests__/FormSelect.test.js | 6 +- .../__tests__/WorksiteSearchInput.test.js | 2 - src/components/phone/AgentBoard/CallInfo.vue | 4 +- src/components/phone/AgentCard.vue | 8 +- src/components/phone/Cards/StatsCard.vue | 11 +- src/components/phone/Popup.vue | 6 +- .../phone/Widgets/GeneralStatistics.vue | 6 +- src/components/phone/Widgets/Leaderboard.vue | 19 +- .../phone/Widgets/PhoneDebugger.vue | 46 +- src/layouts/Authenticated.vue | 73 +- src/main.ts | 282 +- .../phone_legacy/{routes.js => routes.jsx} | 0 src/shims-vue.d.ts | 6 +- src/use/__tests__/phone/useAgent.tests.js | 13 +- src/use/__tests__/useToggle.tests.js | 2 - src/use/__tests__/user/useUser.tests.js | 8 +- src/use/events/useLogEvent.ts | 6 +- src/use/phone/useAgent.ts | 13 +- src/use/phone/useAgentState.ts | 19 +- src/use/phone/useContact.ts | 41 +- src/use/phone/useController.ts | 63 +- src/use/phone/usePhoneMetrics.ts | 4 +- src/use/useCan.ts | 6 +- src/use/user/useUser.ts | 10 +- src/use/worksites/useIncident.ts | 15 +- vite.config.ts | 24 + yarn.lock | 6705 ++--------------- 35 files changed, 1353 insertions(+), 6338 deletions(-) rename public/index.html => index.html (99%) rename src/pages/phone_legacy/{routes.js => routes.jsx} (100%) create mode 100644 vite.config.ts diff --git a/.eslintrc.js b/.eslintrc.js index f32f50d7c3..9ae9778364 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -70,9 +70,12 @@ module.exports = { settings: { 'import/resolver': { - webpack: { - config: './node_modules/@vue/cli-service/webpack.config.js', + node: { + paths: ['src'], + extensions: ['.js', '.jsx', '.ts', '.tsx'], + moduleDirectory: ['node_modules', 'src/'], }, + typescript: {}, }, }, }; diff --git a/.tool-versions b/.tool-versions index 009e1db9d8..d5104da615 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -nodejs 14.17.0 +nodejs 14.20.0 direnv 2.21.2 java adoptopenjdk-8.0.272+10 diff --git a/public/index.html b/index.html similarity index 99% rename from public/index.html rename to index.html index bc24c8f070..eee35748b2 100644 --- a/public/index.html +++ b/index.html @@ -10,7 +10,7 @@ ;NREUM.info={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",licenseKey:"NRJS-15c5a88c5d87c10da34",applicationID:"1046769301",sa:1} - + @@ -34,6 +34,7 @@ We're sorry but crisiscleanup doesn't work properly without JavaScript enabled. Please enable it to continue.
- + + diff --git a/package.json b/package.json index 9083f0072d..07e8f80a96 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "lint-staged": "lint-staged", "postinstall": "yarn cache clean", "prettify": "prettier --write {.,**}/*.js **/*.vue **/**/*.{vue,js}", - "serve-dev": "cross-env NODE_ENV=development NODE_IS_WATCH=1 vue-cli-service serve --mode development", + "dev": "vite --port 8080", + "serve-dev": "cross-env NODE_ENV=development NODE_IS_WATCH=1 vite", "serve-prod": "cross-env NODE_ENV=production NODE_IS_WATCH=1 vue-cli-service serve --mode production", "serve-staging": "cross-env NODE_ENV=staging NODE_IS_WATCH=1 vue-cli-service serve --mode staging", "storybook": "cross-env NODE_ENV=storybook start-storybook -p 6006", @@ -55,12 +56,9 @@ "@ringcentral/sdk": "^4.3.3", "@tailwindcss/line-clamp": "^0.3.1", "@turf/turf": "^5.1.6", - "@u3u/vue-hooks": "^2.0.1", "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "@vue/babel-preset-jsx": "^1.2.4", - "@vue/cli": "4.5.17", "@vue/compat": "^3.1.0", - "@vue/composition-api": "^1.2.1", "@vuex-orm/core": "^0.36.3", "@vuex-orm/plugin-axios": "^0.9.4", "@vuex-orm/plugin-change-flags": "^1.2.3", @@ -128,7 +126,7 @@ "vue-composable": "^1.0.0-beta.18", "vue-cookies": "^1.7.4", "vue-cron-editor-buefy": "^0.2.17", - "vue-easy-lightbox": "^0.16.2", + "vue-easy-lightbox": "1.7.1", "vue-gtag": "^1.9.0", "vue-highlight-words": "^1.2.0", "vue-histogram-slider": "^0.3.8", @@ -191,13 +189,9 @@ "@types/lodash": "^4.14.182", "@typescript-eslint/eslint-plugin": "^4.18.0", "@typescript-eslint/parser": "^4.18.0", + "@vitejs/plugin-vue": "^3.0.1", + "@vitejs/plugin-vue-jsx": "^2.0.0", "@vue/babel-preset-app": "^4.5.4", - "@vue/cli-plugin-babel": "^4.5.11", - "@vue/cli-plugin-e2e-cypress": "^4.5.6", - "@vue/cli-plugin-eslint": "^4.5.6", - "@vue/cli-plugin-typescript": "~4.5.17", - "@vue/cli-plugin-unit-jest": "^5.0.4", - "@vue/cli-service": "^4.5.4", "@vue/compiler-sfc": "^3.1.0", "@vue/eslint-config-typescript": "^7.0.0", "@vue/test-utils": "^1.1.0", @@ -223,12 +217,13 @@ "eslint": "7.32.0", "eslint-config-airbnb-base": "^14.2.0", "eslint-config-prettier": "^6.12.0", + "eslint-import-resolver-typescript": "^3.4.0", "eslint-import-resolver-webpack": "^0.12.2", "eslint-plugin-babel": "^5.3.1", "eslint-plugin-cypress": "^2.11.2", "eslint-plugin-import": "^2.22.0", "eslint-plugin-prettier": "^3.1.4", - "eslint-plugin-vue": "^6.2.2", + "eslint-plugin-vue": "^9.3.0", "eslint-plugin-vue-types": "^2.0.0", "husky": "^8.0.1", "is-ci": "^3.0.1", @@ -270,6 +265,7 @@ "tailwindcss": "npm:@tailwindcss/postcss7-compat", "thread-loader": "^3.0.4", "typescript": "~4.1.5", + "vite": "^3.0.4", "vue-cli-plugin-cypress-experimental": "~1.1.0", "vue-docgen-api": "^4.32.4", "vue-docgen-loader": "^1.5.0", @@ -287,10 +283,9 @@ } }, "lint-staged": { - "*.{js,vue}": [ - "vue-cli-service lint", - "prettier --write", - "git add --force" + "*.{js,ts,vue}": [ + "eslint --fix", + "prettier --write" ], "*.json": [ "prettier --write", diff --git a/src/App.vue b/src/App.vue index 69b490e822..73e4d58913 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,134 +13,133 @@ -