From 2fb1386d6ebdd4dda0b68f709f720d0ad46e88a1 Mon Sep 17 00:00:00 2001 From: Bruno Souza Date: Tue, 31 Oct 2023 10:40:57 -0300 Subject: [PATCH 01/10] Move from vuex to pinia --- .eslintrc.js | 12 + package.json | 6 +- src/components/AccountCard.vue | 33 +- src/components/Header.vue | 13 +- src/components/LoginHandler.vue | 10 +- src/components/LoginHandlerDropdown.vue | 13 +- src/components/MapData.vue | 10 +- src/components/SendDialog.vue | 20 +- src/components/ViewTransanction.vue | 12 +- src/components/WalletModal.vue | 8 +- src/components/WorldMap.vue | 10 +- src/components/contract/ContractActions.vue | 28 +- src/components/contract/ContractTables.vue | 14 +- src/components/contract/ContractTabs.vue | 6 +- src/components/resources/BuyRam.vue | 14 +- src/components/resources/RefundTab.vue | 22 +- src/components/resources/ResourcesInfo.vue | 19 +- src/components/resources/SellRam.vue | 27 +- src/components/resources/StakeTab.vue | 28 +- src/components/resources/UnstakeTab.vue | 46 +- src/components/staking/HistoryTab.vue | 8 +- src/components/staking/ProcessingTab.vue | 15 +- src/components/staking/SavingsTab.vue | 36 +- src/components/staking/StakeFromResources.vue | 30 +- src/components/staking/StakingDialog.vue | 27 +- src/components/staking/StakingInfo.vue | 19 +- src/components/staking/StakingTab.vue | 28 +- src/components/staking/UnstakingTab.vue | 24 +- src/components/transaction/TraceTree.vue | 28 +- .../transaction/TransactionCard.vue | 22 +- src/components/validators/ValidatorData.vue | 20 +- .../validators/ValidatorDataTable.vue | 22 +- src/pages/Account.vue | 6 +- src/pages/Block.vue | 4 +- src/pages/Network.vue | 6 +- src/pages/Proposal.vue | 8 +- src/pages/ProposalItem.vue | 10 +- src/pages/ProposalNew.vue | 12 +- src/pages/TransactionPage.vue | 14 +- src/pages/Vote.vue | 21 +- src/router/index.ts | 2 +- src/store/account/actions.ts | 645 -------------- src/store/account/getters.ts | 23 - src/store/account/index.ts | 14 - src/store/account/mutations.ts | 77 -- src/store/account/state.ts | 86 -- src/store/antelope.store.ts | 49 -- src/store/chain/actions.ts | 99 --- src/store/chain/getters.ts | 10 - src/store/chain/index.ts | 14 - src/store/chain/mutations.ts | 36 - src/store/chain/state.ts | 29 - src/store/contract/actions.ts | 14 - src/store/contract/getters.ts | 9 - src/store/contract/index.ts | 14 - src/store/contract/mutations.ts | 11 - src/store/contract/state.ts | 11 - src/store/index.ts | 68 -- src/store/resources/actions.ts | 228 ----- src/store/resources/getters.ts | 48 - src/store/resources/index.ts | 18 - src/store/resources/mutations.ts | 43 - src/store/resources/state.ts | 30 - src/store/transaction/actions.ts | 18 - src/store/transaction/getters.ts | 13 - src/store/transaction/index.ts | 14 - src/store/transaction/mutations.ts | 50 -- src/store/transaction/state.ts | 31 - src/stores/account.ts | 832 ++++++++++++++++++ src/stores/chain.ts | 162 ++++ src/stores/contract.ts | 37 + src/stores/index.ts | 38 + src/stores/resources.ts | 316 +++++++ src/{store => stores}/store-flag.d.ts | 0 src/stores/transaction.ts | 101 +++ src/types/Actions.ts | 8 +- .../__tests__/store/account/actions.spec.ts | 30 +- .../__tests__/store/antelope.store.spec.ts | 160 ---- .../__tests__/store/resources/actions.spec.ts | 6 +- yarn.lock | 55 +- 80 files changed, 1926 insertions(+), 2234 deletions(-) delete mode 100644 src/store/account/actions.ts delete mode 100644 src/store/account/getters.ts delete mode 100644 src/store/account/index.ts delete mode 100644 src/store/account/mutations.ts delete mode 100644 src/store/account/state.ts delete mode 100644 src/store/antelope.store.ts delete mode 100644 src/store/chain/actions.ts delete mode 100644 src/store/chain/getters.ts delete mode 100644 src/store/chain/index.ts delete mode 100644 src/store/chain/mutations.ts delete mode 100644 src/store/chain/state.ts delete mode 100644 src/store/contract/actions.ts delete mode 100644 src/store/contract/getters.ts delete mode 100644 src/store/contract/index.ts delete mode 100644 src/store/contract/mutations.ts delete mode 100644 src/store/contract/state.ts delete mode 100644 src/store/index.ts delete mode 100644 src/store/resources/actions.ts delete mode 100644 src/store/resources/getters.ts delete mode 100644 src/store/resources/index.ts delete mode 100644 src/store/resources/mutations.ts delete mode 100644 src/store/resources/state.ts delete mode 100644 src/store/transaction/actions.ts delete mode 100644 src/store/transaction/getters.ts delete mode 100644 src/store/transaction/index.ts delete mode 100644 src/store/transaction/mutations.ts delete mode 100644 src/store/transaction/state.ts create mode 100644 src/stores/account.ts create mode 100644 src/stores/chain.ts create mode 100644 src/stores/contract.ts create mode 100644 src/stores/index.ts create mode 100644 src/stores/resources.ts rename src/{store => stores}/store-flag.d.ts (100%) create mode 100644 src/stores/transaction.ts delete mode 100644 test/jest/__tests__/store/antelope.store.spec.ts diff --git a/.eslintrc.js b/.eslintrc.js index 95190bd1..9df31e3e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,6 +46,7 @@ module.exports = { // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file // required to lint *.vue files 'vue', + 'unused-imports', ], globals: { @@ -145,5 +146,16 @@ module.exports = { 'vue/component-options-name-casing': ['error', 'PascalCase'], 'vue/component-definition-name-casing': ['error', 'PascalCase'], 'vue/component-name-in-template-casing': ['error', 'PascalCase'], + 'no-unused-vars': 'off', + 'unused-imports/no-unused-imports': 'error', + 'unused-imports/no-unused-vars': [ + 'warn', + { + 'vars': 'all', + 'varsIgnorePattern': '^_', + 'args': 'after-used', + 'argsIgnorePattern': '^_' + } + ], } } diff --git a/package.json b/package.json index d4658e1d..5718525c 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,8 @@ "highcharts-vue": "^1.4.0", "moment": "^2.29.4", "ol": "^6.14.1", + "pinia": "^2.1.6", + "pm2": "^5.3.0", "quasar": "^2.6.2", "ual-anchor": "1.3.0", "universal-authenticator-library": "^0.3.0", @@ -31,8 +33,7 @@ "vue-class-component": "^7.2.6", "vue-json-viewer": "^3.0.4", "vue-router": "^4.0.0", - "vue3-openlayers": "^0.1.63", - "vuex": "^4.0.1" + "vue3-openlayers": "^0.1.63" }, "devDependencies": { "@babel/eslint-parser": "^7.13.14", @@ -45,6 +46,7 @@ "dotenv": "^14.3.0", "eslint": "^7.14.0", "eslint-plugin-jest": "^25.2.2", + "eslint-plugin-unused-imports": "^3.0.0", "eslint-plugin-vue": "^9.0.0", "node-polyfill-webpack-plugin": "^1.1.4", "vue-property-decorator": "^9.1.2" diff --git a/src/components/AccountCard.vue b/src/components/AccountCard.vue index 87ec9bd6..003acf99 100644 --- a/src/components/AccountCard.vue +++ b/src/components/AccountCard.vue @@ -1,14 +1,12 @@