From d1c302c85307d62f63b550b12f15c1b6c31370f7 Mon Sep 17 00:00:00 2001 From: Aritra Chatterjee Date: Mon, 4 Mar 2024 14:35:38 +0530 Subject: [PATCH] fix: run eslint imports sort on webapp files --- packages/webapp/.eslintrc.cjs | 33 +++++- packages/webapp/.vscode/settings.json | 6 +- packages/webapp/package.json | 4 +- packages/webapp/src/actions/concede.ts | 2 +- packages/webapp/src/actions/defend.ts | 2 +- packages/webapp/src/actions/drawCard.ts | 12 +-- packages/webapp/src/actions/endTurn.ts | 2 +- packages/webapp/src/actions/errors.ts | 6 +- packages/webapp/src/actions/joinGame.ts | 21 ++-- .../webapp/src/actions/libContractWrite.ts | 4 +- packages/webapp/src/actions/playCard.ts | 12 +-- packages/webapp/src/chain.ts | 3 +- .../webapp/src/components/cards/boardCard.tsx | 4 +- .../src/components/cards/cardContainer.tsx | 10 +- .../src/components/cards/draggedCard.tsx | 3 +- .../webapp/src/components/cards/handCard.tsx | 1 + .../collection/cardCollectionDisplay.tsx | 3 +- .../src/components/collection/deckList.tsx | 3 +- .../src/components/collection/deckPanel.tsx | 5 +- .../src/components/collection/filterPanel.tsx | 1 + packages/webapp/src/components/hand.tsx | 11 +- packages/webapp/src/components/lib/modal.tsx | 2 +- .../src/components/lib/modalElements.tsx | 1 + packages/webapp/src/components/link.tsx | 2 +- .../src/components/modals/createGameModal.tsx | 16 +-- .../src/components/modals/gameEndedModal.tsx | 6 +- .../components/modals/globalErrorModal.tsx | 5 +- .../modals/inGameMenuModalContent.tsx | 3 +- .../src/components/modals/joinGameModal.tsx | 22 ++-- .../src/components/modals/loadingModal.tsx | 2 +- .../src/components/modals/mintDeckModal.tsx | 4 +- packages/webapp/src/components/navbar.tsx | 4 +- .../webapp/src/components/playerBoard.tsx | 5 +- packages/webapp/src/components/ui/button.tsx | 2 +- packages/webapp/src/components/ui/dialog.tsx | 2 +- .../src/components/ui/navigation-menu.tsx | 2 +- packages/webapp/src/components/ui/sonner.tsx | 1 + packages/webapp/src/deployment.ts | 2 +- packages/webapp/src/game/drawInitialHand.ts | 4 +- packages/webapp/src/game/fableProofs.ts | 2 +- packages/webapp/src/game/misc.ts | 2 +- .../src/hooks/useCancellationHandler.ts | 3 +- packages/webapp/src/hooks/useChainWrite.ts | 4 +- packages/webapp/src/hooks/useDebug.ts | 1 + packages/webapp/src/hooks/useDragEvents.ts | 9 +- packages/webapp/src/hooks/useFableWrite.ts | 6 +- packages/webapp/src/pages/_app.tsx | 17 +-- packages/webapp/src/pages/collection.tsx | 22 ++-- packages/webapp/src/pages/index.tsx | 9 +- packages/webapp/src/pages/play.tsx | 54 +++++----- packages/webapp/src/store/atoms.ts | 2 +- packages/webapp/src/store/hooks.ts | 1 - packages/webapp/src/store/network.ts | 9 +- packages/webapp/src/store/setup.ts | 5 +- packages/webapp/src/store/subscriptions.ts | 9 +- packages/webapp/src/store/update.ts | 21 ++-- packages/webapp/src/store/write.ts | 4 +- packages/webapp/src/utils/jotai.ts | 2 +- packages/webapp/src/utils/react-utils.ts | 2 +- .../webapp/src/utils/zkproofs/proofWorker.ts | 2 +- packages/webapp/src/utils/zkproofs/proofs.ts | 2 +- packages/webapp/src/wagmi/BurnerConnector.ts | 8 +- packages/webapp/wagmi.config.ts | 3 +- pnpm-lock.yaml | 102 +++++++++++++++--- 64 files changed, 324 insertions(+), 210 deletions(-) diff --git a/packages/webapp/.eslintrc.cjs b/packages/webapp/.eslintrc.cjs index 3d4bad6d..6e05e0c1 100644 --- a/packages/webapp/.eslintrc.cjs +++ b/packages/webapp/.eslintrc.cjs @@ -3,9 +3,11 @@ const config = { extends: ["next/core-web-vitals", "plugin:@typescript-eslint/recommended", "prettier"], parser: "@typescript-eslint/parser", parserOptions: { - project: "./tsconfig.json", - }, - plugins: ["@typescript-eslint"], + project: "./tsconfig.json", + "sourceType": "module", + "ecmaVersion": "latest", + }, + plugins: ["@typescript-eslint", "simple-import-sort"], root: true, ignorePatterns: ["node_modules", "src/hooks/useScrollBox.ts"], rules: { @@ -26,6 +28,31 @@ const config = { caughtErrorsIgnorePattern: "^_", }, ], + "import/first": "error", + "import/newline-after-import": "error", + "import/no-duplicates": "error", + "simple-import-sort/imports": [ + "error", + { + "groups": [ + // Packages. `react` related packages come first. + [ + "^react", + "^next", + ], + // Internal packages. + ["^@?\\w"], + // Parent imports. Put `..` last. + ["^\\.\\.(?!/?$)", "^\\.\\./?$"], + // Other relative imports. Put same-folder imports and `.` last. + ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"], + // Style imports. + ["^.+\\.s?css$"], + // Side effect imports. + ["^\\u0000"] + ] + } + ] }, } diff --git a/packages/webapp/.vscode/settings.json b/packages/webapp/.vscode/settings.json index f288ef4a..2f0fcb6b 100644 --- a/packages/webapp/.vscode/settings.json +++ b/packages/webapp/.vscode/settings.json @@ -1,4 +1,8 @@ { "javascript.validate.enable": false, - "typescript.validate.enable": false + "typescript.validate.enable": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"] } diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 241f462a..3f348273 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -19,7 +19,6 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "connectkit": "^1.5.3", - "eslint-config-prettier": "^9.1.0", "jotai": "^2.4.3", "jotai-devtools": "^0.7.0", "lodash": "^4.17.21", @@ -52,6 +51,9 @@ "autoprefixer": "^10.4.16", "eslint": "^8.52.0", "eslint-config-next": "^13.5.6", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-simple-import-sort": "^12.0.0", "postcss": "^8.4.31", "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.3.3", diff --git a/packages/webapp/src/actions/concede.ts b/packages/webapp/src/actions/concede.ts index e15ac381..55d9805f 100644 --- a/packages/webapp/src/actions/concede.ts +++ b/packages/webapp/src/actions/concede.ts @@ -1,9 +1,9 @@ import { defaultErrorHandling } from "src/actions/errors" -import { checkFresh, freshWrap } from "src/store/checkFresh" import { contractWriteThrowing } from "src/actions/libContractWrite" import { Address } from "src/chain" import { deployment } from "src/deployment" import { gameABI } from "src/generated" +import { checkFresh, freshWrap } from "src/store/checkFresh" // ================================================================================================= diff --git a/packages/webapp/src/actions/defend.ts b/packages/webapp/src/actions/defend.ts index 48d465a6..6bc9630a 100644 --- a/packages/webapp/src/actions/defend.ts +++ b/packages/webapp/src/actions/defend.ts @@ -1,9 +1,9 @@ import { defaultErrorHandling } from "src/actions/errors" -import { checkFresh, freshWrap } from "src/store/checkFresh" import { contractWriteThrowing } from "src/actions/libContractWrite" import { Address } from "src/chain" import { deployment } from "src/deployment" import { gameABI } from "src/generated" +import { checkFresh, freshWrap } from "src/store/checkFresh" // ================================================================================================= diff --git a/packages/webapp/src/actions/drawCard.ts b/packages/webapp/src/actions/drawCard.ts index e21bcbae..46e40e88 100644 --- a/packages/webapp/src/actions/drawCard.ts +++ b/packages/webapp/src/actions/drawCard.ts @@ -8,10 +8,12 @@ import { defaultErrorHandling } from "src/actions/errors" import { contractWriteThrowing } from "src/actions/libContractWrite" import { Address, type HexString } from "src/chain" +import { CancellationHandler } from "src/components/modals/loadingModal" +import { DRAW_CARD_PROOF_TIMEOUT } from "src/constants" import { deployment } from "src/deployment" import { packCards } from "src/game/fableProofs" import { gameABI } from "src/generated" -import { getOrInitPrivateInfo, setPrivateInfo } from "src/store/write" +import { checkFresh, freshWrap } from "src/store/checkFresh" import { getCards, getCurrentPlayerAddress, @@ -21,12 +23,10 @@ import { getPlayerAddress, } from "src/store/read" import { GameStep, PrivateInfo } from "src/store/types" -import { FAKE_PROOF, proveInWorker, SHOULD_GENERATE_PROOFS } from "src/utils/zkproofs" -import { bigintToHexString } from "src/utils/js-utils" +import { getOrInitPrivateInfo, setPrivateInfo } from "src/store/write" import { mimcHash } from "src/utils/hashing" -import { DRAW_CARD_PROOF_TIMEOUT } from "src/constants" -import { CancellationHandler } from "src/components/modals/loadingModal" -import { checkFresh, freshWrap } from "src/store/checkFresh" +import { bigintToHexString } from "src/utils/js-utils" +import { FAKE_PROOF, proveInWorker, SHOULD_GENERATE_PROOFS } from "src/utils/zkproofs" // ================================================================================================= diff --git a/packages/webapp/src/actions/endTurn.ts b/packages/webapp/src/actions/endTurn.ts index 14e3a24d..6d6829e8 100644 --- a/packages/webapp/src/actions/endTurn.ts +++ b/packages/webapp/src/actions/endTurn.ts @@ -10,9 +10,9 @@ import { contractWriteThrowing } from "src/actions/libContractWrite" import { Address } from "src/chain" import { deployment } from "src/deployment" import { gameABI } from "src/generated" +import { checkFresh, freshWrap } from "src/store/checkFresh" import { getCurrentPlayerAddress, getGameData, getGameID, getPlayerAddress } from "src/store/read" import { GameStep } from "src/store/types" -import { checkFresh, freshWrap } from "src/store/checkFresh" // ================================================================================================= diff --git a/packages/webapp/src/actions/errors.ts b/packages/webapp/src/actions/errors.ts index fe8fca64..56503cfd 100644 --- a/packages/webapp/src/actions/errors.ts +++ b/packages/webapp/src/actions/errors.ts @@ -8,15 +8,13 @@ * @module actions/errors */ -import { ContractFunctionRevertedError, UserRejectedRequestError } from "viem" - import { ContractWriteError } from "src/actions/libContractWrite" import { GIT_ISSUES } from "src/constants" -import { setError } from "src/store/write" - import { StaleError } from "src/store/checkFresh" +import { setError } from "src/store/write" import { TimeoutError } from "src/utils/errors" import { ProofCancelled, ProofError, ProofTimeoutError } from "src/utils/zkproofs/proofs" +import { ContractFunctionRevertedError, UserRejectedRequestError } from "viem" // ================================================================================================= // ERRORS diff --git a/packages/webapp/src/actions/joinGame.ts b/packages/webapp/src/actions/joinGame.ts index fbb1c6ed..72af0b54 100644 --- a/packages/webapp/src/actions/joinGame.ts +++ b/packages/webapp/src/actions/joinGame.ts @@ -5,16 +5,18 @@ * @module action/joinGame */ -import { decodeEventLog } from "viem" - import { defaultErrorHandling, FableRequestTimeout, InconsistentGameStateError } from "src/actions/errors" import { contractWriteThrowing } from "src/actions/libContractWrite" import { Address } from "src/chain" +import { CancellationHandler } from "src/components/modals/loadingModal" +import { DRAW_HAND_PROOF_TIMEOUT } from "src/constants" import { deployment } from "src/deployment" +import { NUM_CARDS_FOR_PROOF } from "src/game/constants" import { drawInitialHand } from "src/game/drawInitialHand" +import { packCards } from "src/game/fableProofs" import { gameABI } from "src/generated" -import { waitForUpdate } from "src/store/update" -import { getOrInitPrivateInfo, setGameID, setPrivateInfo } from "src/store/write" +import { checkFresh, freshWrap } from "src/store/checkFresh" +import { getPlayerHand } from "src/store/derive" import { getCards, getDeck, @@ -26,13 +28,10 @@ import { isGameReadyToStart, } from "src/store/read" import { FetchedGameData, GameStatus, PlayerData, PrivateInfo } from "src/store/types" -import { SHOULD_GENERATE_PROOFS, FAKE_PROOF, ProofOutput, proveInWorker } from "src/utils/zkproofs" -import { NUM_CARDS_FOR_PROOF } from "src/game/constants" -import { packCards } from "src/game/fableProofs" -import { DRAW_HAND_PROOF_TIMEOUT } from "src/constants" -import { CancellationHandler } from "src/components/modals/loadingModal" -import { checkFresh, freshWrap } from "src/store/checkFresh" -import { getPlayerHand } from "src/store/derive" +import { waitForUpdate } from "src/store/update" +import { getOrInitPrivateInfo, setGameID, setPrivateInfo } from "src/store/write" +import { FAKE_PROOF, ProofOutput, proveInWorker,SHOULD_GENERATE_PROOFS } from "src/utils/zkproofs" +import { decodeEventLog } from "viem" // ================================================================================================= diff --git a/packages/webapp/src/actions/libContractWrite.ts b/packages/webapp/src/actions/libContractWrite.ts index 883352b2..3362aeca 100644 --- a/packages/webapp/src/actions/libContractWrite.ts +++ b/packages/webapp/src/actions/libContractWrite.ts @@ -4,6 +4,7 @@ * @module ui/libContractWrite */ +import type { Address, Hash } from "src/chain" import { Abi, ContractFunctionExecutionError, @@ -13,11 +14,8 @@ import { TransactionExecutionError, TransactionReceipt, } from "viem" - import { prepareWriteContract, waitForTransaction, writeContract } from "wagmi/actions" -import type { Address, Hash } from "src/chain" - // ================================================================================================= /** Arguments to {@link contractWrite}. */ diff --git a/packages/webapp/src/actions/playCard.ts b/packages/webapp/src/actions/playCard.ts index da37e81e..91f7a128 100644 --- a/packages/webapp/src/actions/playCard.ts +++ b/packages/webapp/src/actions/playCard.ts @@ -8,18 +8,18 @@ import { defaultErrorHandling } from "src/actions/errors" import { contractWriteThrowing } from "src/actions/libContractWrite" import { Address, type HexString } from "src/chain" +import { CancellationHandler } from "src/components/modals/loadingModal" +import { PLAY_CARD_PROOF_TIMEOUT } from "src/constants" import { deployment } from "src/deployment" import { packCards } from "src/game/fableProofs" import { gameABI } from "src/generated" -import { getOrInitPrivateInfo, setPrivateInfo } from "src/store/write" +import { checkFresh, freshWrap } from "src/store/checkFresh" import { getCards, getCurrentPlayerAddress, getGameData, getGameID, getPlayerAddress } from "src/store/read" import { GameStep, PrivateInfo } from "src/store/types" -import { FAKE_PROOF, proveInWorker, SHOULD_GENERATE_PROOFS } from "src/utils/zkproofs" -import { bigintToHexString } from "src/utils/js-utils" +import { getOrInitPrivateInfo, setPrivateInfo } from "src/store/write" import { mimcHash } from "src/utils/hashing" -import { PLAY_CARD_PROOF_TIMEOUT } from "src/constants" -import { CancellationHandler } from "src/components/modals/loadingModal" -import { checkFresh, freshWrap } from "src/store/checkFresh" +import { bigintToHexString } from "src/utils/js-utils" +import { FAKE_PROOF, proveInWorker, SHOULD_GENERATE_PROOFS } from "src/utils/zkproofs" // ================================================================================================= diff --git a/packages/webapp/src/chain.ts b/packages/webapp/src/chain.ts index 348f8eb3..6d4cd448 100644 --- a/packages/webapp/src/chain.ts +++ b/packages/webapp/src/chain.ts @@ -5,11 +5,10 @@ */ import { getDefaultConfig, getDefaultConnectors } from "connectkit" +import { BurnerConnector } from "src/wagmi/BurnerConnector" import { type Chain, createConfig } from "wagmi" import { localhost } from "wagmi/chains" -import { BurnerConnector } from "src/wagmi/BurnerConnector" - // ================================================================================================= /** The list of chains supported by the app. */ diff --git a/packages/webapp/src/components/cards/boardCard.tsx b/packages/webapp/src/components/cards/boardCard.tsx index 370218c4..ff7cdfb1 100644 --- a/packages/webapp/src/components/cards/boardCard.tsx +++ b/packages/webapp/src/components/cards/boardCard.tsx @@ -1,6 +1,6 @@ -import { forwardRef, useState } from "react" +import React, { forwardRef, useState } from "react" import Image from "next/image" -import React from "react" + import { testCards } from "src/utils/card-list" interface BoardCardProps { diff --git a/packages/webapp/src/components/cards/cardContainer.tsx b/packages/webapp/src/components/cards/cardContainer.tsx index 9c5fcfa1..6ee89971 100644 --- a/packages/webapp/src/components/cards/cardContainer.tsx +++ b/packages/webapp/src/components/cards/cardContainer.tsx @@ -1,12 +1,14 @@ import React from "react" -import { CardPlacement } from "src/store/types" + import { useSortable } from "@dnd-kit/sortable" -import DraggedCard from "./draggedCard" -import BoardCard from "./boardCard" -import HandCard from "./handCard" import { CSS } from "@dnd-kit/utilities" +import { CardPlacement } from "src/store/types" import { convertStringToSafeNumber } from "src/utils/js-utils" +import BoardCard from "./boardCard" +import DraggedCard from "./draggedCard" +import HandCard from "./handCard" + interface BaseCardProps { id: string className?: string diff --git a/packages/webapp/src/components/cards/draggedCard.tsx b/packages/webapp/src/components/cards/draggedCard.tsx index 06a90ee7..2f2e80bc 100644 --- a/packages/webapp/src/components/cards/draggedCard.tsx +++ b/packages/webapp/src/components/cards/draggedCard.tsx @@ -1,5 +1,6 @@ -import Image from "next/image" import React, { forwardRef } from "react" +import Image from "next/image" + import { testCards } from "src/utils/card-list" interface DraggedCardProps { diff --git a/packages/webapp/src/components/cards/handCard.tsx b/packages/webapp/src/components/cards/handCard.tsx index 18ad9240..5feb8f39 100644 --- a/packages/webapp/src/components/cards/handCard.tsx +++ b/packages/webapp/src/components/cards/handCard.tsx @@ -1,5 +1,6 @@ import React, { forwardRef, useState } from "react" import Image from "next/image" + import { testCards } from "src/utils/card-list" interface HandCardProps { diff --git a/packages/webapp/src/components/collection/cardCollectionDisplay.tsx b/packages/webapp/src/components/collection/cardCollectionDisplay.tsx index f3911809..ffec6b8c 100644 --- a/packages/webapp/src/components/collection/cardCollectionDisplay.tsx +++ b/packages/webapp/src/components/collection/cardCollectionDisplay.tsx @@ -1,7 +1,8 @@ import React from "react" import Image from "next/image" -import { Card } from "src/store/types" + import { MintDeckModal } from "src/components/modals/mintDeckModal" +import { Card } from "src/store/types" import { testCards } from "src/utils/card-list" interface CardCollectionDisplayProps { diff --git a/packages/webapp/src/components/collection/deckList.tsx b/packages/webapp/src/components/collection/deckList.tsx index d85fdc10..89abdaa3 100644 --- a/packages/webapp/src/components/collection/deckList.tsx +++ b/packages/webapp/src/components/collection/deckList.tsx @@ -1,7 +1,8 @@ import React from "react" + import Link from "src/components/link" -import { Deck } from "src/store/types" import { Button } from "src/components/ui/button" +import { Deck } from "src/store/types" interface DeckCollectionDisplayProps { decks: Deck[] diff --git a/packages/webapp/src/components/collection/deckPanel.tsx b/packages/webapp/src/components/collection/deckPanel.tsx index 63a4b7b4..c7bc2e32 100644 --- a/packages/webapp/src/components/collection/deckPanel.tsx +++ b/packages/webapp/src/components/collection/deckPanel.tsx @@ -1,8 +1,9 @@ import React, { useState } from "react" -import { Deck, Card } from "src/store/types" import Image from "next/image" -import { testCards } from "src/utils/card-list" + import { Button } from "src/components/ui/button" +import { Card,Deck } from "src/store/types" +import { testCards } from "src/utils/card-list" interface DeckConstructionPanelProps { deck: Deck diff --git a/packages/webapp/src/components/collection/filterPanel.tsx b/packages/webapp/src/components/collection/filterPanel.tsx index f3089936..6e4e9931 100644 --- a/packages/webapp/src/components/collection/filterPanel.tsx +++ b/packages/webapp/src/components/collection/filterPanel.tsx @@ -1,5 +1,6 @@ import React from "react" import Image from "next/image" + import { Card } from "src/store/types" interface FilterPanelProps { diff --git a/packages/webapp/src/components/hand.tsx b/packages/webapp/src/components/hand.tsx index b38ff4d4..e1412bb9 100644 --- a/packages/webapp/src/components/hand.tsx +++ b/packages/webapp/src/components/hand.tsx @@ -1,11 +1,14 @@ import { useEffect, useRef, useState } from "react" import { AiOutlineLeft, AiOutlineRight } from "react-icons/ai" -import useScrollBox from "../hooks/useScrollBox" -import { SortableContext, horizontalListSortingStrategy, useSortable } from "@dnd-kit/sortable" + +import { horizontalListSortingStrategy, SortableContext, useSortable } from "@dnd-kit/sortable" +import { CancellationHandler } from "src/components/modals/loadingModal" import { CardPlacement } from "src/store/types" -import CardContainer from "./cards/cardContainer" import { convertBigIntArrayToStringArray } from "src/utils/js-utils" -import { CancellationHandler } from "src/components/modals/loadingModal" + +import useScrollBox from "../hooks/useScrollBox" + +import CardContainer from "./cards/cardContainer" const Hand = ({ cards, diff --git a/packages/webapp/src/components/lib/modal.tsx b/packages/webapp/src/components/lib/modal.tsx index a9b874b7..f2b91fd0 100644 --- a/packages/webapp/src/components/lib/modal.tsx +++ b/packages/webapp/src/components/lib/modal.tsx @@ -1,8 +1,8 @@ import React, { ReactNode, RefObject, useRef, useState } from "react" +import { createPortal } from "react-dom" import { useIsMounted } from "src/hooks/useIsMounted" import { useErrorConfig } from "src/store/hooks" -import { createPortal } from "react-dom" // ================================================================================================= diff --git a/packages/webapp/src/components/lib/modalElements.tsx b/packages/webapp/src/components/lib/modalElements.tsx index 95674911..9626b739 100644 --- a/packages/webapp/src/components/lib/modalElements.tsx +++ b/packages/webapp/src/components/lib/modalElements.tsx @@ -1,6 +1,7 @@ // ================================================================================================= import Image from "next/image" + import { Button } from "src/components/ui/button" export const Spinner = () => { diff --git a/packages/webapp/src/components/link.tsx b/packages/webapp/src/components/link.tsx index 9cdc831b..581121f2 100644 --- a/packages/webapp/src/components/link.tsx +++ b/packages/webapp/src/components/link.tsx @@ -1,6 +1,6 @@ import React from "react" -import { useRouter } from "next/router" import Link from "next/link" +import { useRouter } from "next/router" interface QueryParamLinkProps { children: React.ReactNode diff --git a/packages/webapp/src/components/modals/createGameModal.tsx b/packages/webapp/src/components/modals/createGameModal.tsx index e77b7b86..9d1195f7 100644 --- a/packages/webapp/src/components/modals/createGameModal.tsx +++ b/packages/webapp/src/components/modals/createGameModal.tsx @@ -1,20 +1,20 @@ -import { useRouter } from "next/router" import { useCallback, useEffect, useState } from "react" -import { decodeEventLog } from "viem" +import { useRouter } from "next/router" -import { LoadingModalContent } from "src/components/modals/loadingModal" +import { joinGame, reportInconsistentGameState } from "src/actions" +import { concede } from "src/actions/concede" import { Spinner } from "src/components/lib/modalElements" import { InGameMenuModalContent } from "src/components/modals/inGameMenuModalContent" +import { LoadingModalContent } from "src/components/modals/loadingModal" +import { Button } from "src/components/ui/button" +import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "src/components/ui/dialog" import { gameABI } from "src/generated" +import { useCancellationHandler } from "src/hooks/useCancellationHandler" import { useGameWrite } from "src/hooks/useFableWrite" import * as store from "src/store/hooks" -import { joinGame, reportInconsistentGameState } from "src/actions" import { GameStatus } from "src/store/types" import { navigate } from "src/utils/navigate" -import { useCancellationHandler } from "src/hooks/useCancellationHandler" -import { concede } from "src/actions/concede" -import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "src/components/ui/dialog" -import { Button } from "src/components/ui/button" +import { decodeEventLog } from "viem" interface CreateGameModalContentProps { loading: string | null diff --git a/packages/webapp/src/components/modals/gameEndedModal.tsx b/packages/webapp/src/components/modals/gameEndedModal.tsx index 6926b3e5..ddacc728 100644 --- a/packages/webapp/src/components/modals/gameEndedModal.tsx +++ b/packages/webapp/src/components/modals/gameEndedModal.tsx @@ -1,10 +1,10 @@ -import { useRouter } from "next/router" import { useCallback, useState } from "react" +import { useRouter } from "next/router" +import { Button } from "src/components/ui/button" +import { Dialog, DialogContent,DialogDescription, DialogTitle } from "src/components/ui/dialog" import { useGameData, useGameID } from "src/store/hooks" import { navigate } from "src/utils/navigate" -import { Dialog, DialogDescription, DialogTitle, DialogContent } from "src/components/ui/dialog" -import { Button } from "src/components/ui/button" /** * This modal is displayed in the "/play" page, when the game ends. It can be dismissed if the diff --git a/packages/webapp/src/components/modals/globalErrorModal.tsx b/packages/webapp/src/components/modals/globalErrorModal.tsx index 0b8bf72b..c63011c1 100644 --- a/packages/webapp/src/components/modals/globalErrorModal.tsx +++ b/packages/webapp/src/components/modals/globalErrorModal.tsx @@ -1,8 +1,9 @@ +import { useEffect, useState } from "react" + +import { Button } from "src/components/ui/button" import { ErrorConfig } from "src/store/types" import { Dialog, DialogContent, DialogTitle } from "../ui/dialog" -import { Button } from "src/components/ui/button" -import { useEffect, useState } from "react" /** * A modal displayed globally (setup in _app.tsx) whenever the errorConfig state is set to non-null. diff --git a/packages/webapp/src/components/modals/inGameMenuModalContent.tsx b/packages/webapp/src/components/modals/inGameMenuModalContent.tsx index 5cf14e87..7ee356c3 100644 --- a/packages/webapp/src/components/modals/inGameMenuModalContent.tsx +++ b/packages/webapp/src/components/modals/inGameMenuModalContent.tsx @@ -1,8 +1,9 @@ import Link from "next/link" -import { DialogDescription, DialogTitle } from "../ui/dialog" import { Button } from "src/components/ui/button" +import { DialogDescription, DialogTitle } from "../ui/dialog" + /** * This modal content is shared by both the {@link CreateGameModal} (for the game creator) and the * {@link JoinGameModal} (for the joiner), and is displayed when the game is in progress but the diff --git a/packages/webapp/src/components/modals/joinGameModal.tsx b/packages/webapp/src/components/modals/joinGameModal.tsx index 6d0161ca..8a093c7e 100644 --- a/packages/webapp/src/components/modals/joinGameModal.tsx +++ b/packages/webapp/src/components/modals/joinGameModal.tsx @@ -1,22 +1,22 @@ -import debounce from "lodash/debounce" -import { useRouter } from "next/router" import React, { useEffect, useMemo, useState } from "react" +import { useRouter } from "next/router" + +import debounce from "lodash/debounce" +import { joinGame, reportInconsistentGameState } from "src/actions" +import { concede } from "src/actions/concede" import { Spinner } from "src/components/lib/modalElements" import { InGameMenuModalContent } from "src/components/modals/inGameMenuModalContent" - -import * as store from "src/store/hooks" -import { isStringPositiveInteger, parseBigIntOrNull } from "src/utils/js-utils" import { LoadingModalContent } from "src/components/modals/loadingModal" -import { joinGame, reportInconsistentGameState } from "src/actions" -import { setError } from "src/store/write" +import { Button } from "src/components/ui/button" +import { Input } from "src/components/ui/input" +import { useCancellationHandler } from "src/hooks/useCancellationHandler" +import * as store from "src/store/hooks" import { GameStatus } from "src/store/types" +import { setError } from "src/store/write" +import { isStringPositiveInteger, parseBigIntOrNull } from "src/utils/js-utils" import { navigate } from "src/utils/navigate" -import { useCancellationHandler } from "src/hooks/useCancellationHandler" -import { concede } from "src/actions/concede" import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "../ui/dialog" -import { Button } from "src/components/ui/button" -import { Input } from "src/components/ui/input" interface JoinGameModalContentProps { loading: string | null diff --git a/packages/webapp/src/components/modals/loadingModal.tsx b/packages/webapp/src/components/modals/loadingModal.tsx index 579eb8b5..24cbaa5b 100644 --- a/packages/webapp/src/components/modals/loadingModal.tsx +++ b/packages/webapp/src/components/modals/loadingModal.tsx @@ -1,8 +1,8 @@ import { ReactNode, useCallback } from "react" import { Spinner } from "src/components/lib/modalElements" -import { Dialog, DialogDescription, DialogTitle, DialogContent } from "src/components/ui/dialog" import { Button } from "src/components/ui/button" +import { Dialog, DialogContent,DialogDescription, DialogTitle } from "src/components/ui/dialog" // ================================================================================================= diff --git a/packages/webapp/src/components/modals/mintDeckModal.tsx b/packages/webapp/src/components/modals/mintDeckModal.tsx index 87a8ac74..a169fecf 100644 --- a/packages/webapp/src/components/modals/mintDeckModal.tsx +++ b/packages/webapp/src/components/modals/mintDeckModal.tsx @@ -1,9 +1,9 @@ import { useState } from "react" -import { useDeckAirdropWrite } from "src/hooks/useFableWrite" import { LoadingModalContent } from "src/components/modals/loadingModal" -import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "src/components/ui/dialog" import { Button } from "src/components/ui/button" +import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "src/components/ui/dialog" +import { useDeckAirdropWrite } from "src/hooks/useFableWrite" interface MintDeckModalContentProps { loading: string | null diff --git a/packages/webapp/src/components/navbar.tsx b/packages/webapp/src/components/navbar.tsx index b5f15b94..89f81527 100644 --- a/packages/webapp/src/components/navbar.tsx +++ b/packages/webapp/src/components/navbar.tsx @@ -1,7 +1,9 @@ import Link from "next/link" + import { ConnectKitButton } from "connectkit" +import { NavigationMenu, NavigationMenuItem,NavigationMenuList } from "src/components/ui/navigation-menu" + import { Button } from "./ui/button" -import { NavigationMenu, NavigationMenuList, NavigationMenuItem } from "src/components/ui/navigation-menu" export const Navbar = () => { return ( diff --git a/packages/webapp/src/components/playerBoard.tsx b/packages/webapp/src/components/playerBoard.tsx index 7c33b0f8..ccd37cec 100644 --- a/packages/webapp/src/components/playerBoard.tsx +++ b/packages/webapp/src/components/playerBoard.tsx @@ -1,7 +1,8 @@ -import * as store from "src/store/hooks" -import { convertBigIntArrayToStringArray, shortenAddress } from "src/utils/js-utils" import { horizontalListSortingStrategy, SortableContext, useSortable } from "@dnd-kit/sortable" +import * as store from "src/store/hooks" import { CardPlacement } from "src/store/types" +import { convertBigIntArrayToStringArray, shortenAddress } from "src/utils/js-utils" + import CardContainer from "./cards/cardContainer" interface PlayerBoardProps { diff --git a/packages/webapp/src/components/ui/button.tsx b/packages/webapp/src/components/ui/button.tsx index 0648de01..93b33424 100644 --- a/packages/webapp/src/components/ui/button.tsx +++ b/packages/webapp/src/components/ui/button.tsx @@ -1,7 +1,7 @@ import * as React from "react" + import { Slot } from "@radix-ui/react-slot" import { cva, type VariantProps } from "class-variance-authority" - import { cn } from "src/utils/ui-utils" // ref: https://ui.shadcn.com/docs/components/button diff --git a/packages/webapp/src/components/ui/dialog.tsx b/packages/webapp/src/components/ui/dialog.tsx index dcdc5d8e..64eadc22 100644 --- a/packages/webapp/src/components/ui/dialog.tsx +++ b/packages/webapp/src/components/ui/dialog.tsx @@ -1,7 +1,7 @@ import * as React from "react" + import * as DialogPrimitive from "@radix-ui/react-dialog" import { X } from "lucide-react" - import { cn } from "src/utils/ui-utils" const Dialog = DialogPrimitive.Root diff --git a/packages/webapp/src/components/ui/navigation-menu.tsx b/packages/webapp/src/components/ui/navigation-menu.tsx index 08458a2e..2fb7d0ec 100644 --- a/packages/webapp/src/components/ui/navigation-menu.tsx +++ b/packages/webapp/src/components/ui/navigation-menu.tsx @@ -1,8 +1,8 @@ import * as React from "react" + import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu" import { cva } from "class-variance-authority" import { ChevronDown } from "lucide-react" - import { cn } from "src/utils/ui-utils" // ref: https://ui.shadcn.com/docs/components/navigation-menu diff --git a/packages/webapp/src/components/ui/sonner.tsx b/packages/webapp/src/components/ui/sonner.tsx index bb08b5c0..3edc70b7 100644 --- a/packages/webapp/src/components/ui/sonner.tsx +++ b/packages/webapp/src/components/ui/sonner.tsx @@ -1,4 +1,5 @@ import { useTheme } from "next-themes" + import { Toaster as Sonner } from "sonner" type ToasterProps = React.ComponentProps diff --git a/packages/webapp/src/deployment.ts b/packages/webapp/src/deployment.ts index e97311e1..a47e0173 100644 --- a/packages/webapp/src/deployment.ts +++ b/packages/webapp/src/deployment.ts @@ -5,8 +5,8 @@ * @module deployment */ -import type { Address } from "wagmi" import * as deployment_ from "contracts/out/deployment.json" assert { type: "json" } +import type { Address } from "wagmi" export interface Deployment { CardsCollection: Address diff --git a/packages/webapp/src/game/drawInitialHand.ts b/packages/webapp/src/game/drawInitialHand.ts index 2e9601d7..681ec155 100644 --- a/packages/webapp/src/game/drawInitialHand.ts +++ b/packages/webapp/src/game/drawInitialHand.ts @@ -5,9 +5,9 @@ */ import { Hash } from "src/chain" -import { mimcHash } from "src/utils/hashing" -import { PrivateInfo } from "src/store/types" import { FELT_SIZE, INITIAL_HAND_SIZE, MAX_DECK_SIZE, MAX_HAND_SIZE } from "src/game/constants" +import { PrivateInfo } from "src/store/types" +import { mimcHash } from "src/utils/hashing" import { bigintToHexString, parseBigInt } from "src/utils/js-utils" // ================================================================================================= diff --git a/packages/webapp/src/game/fableProofs.ts b/packages/webapp/src/game/fableProofs.ts index 68a77948..2b75cfee 100644 --- a/packages/webapp/src/game/fableProofs.ts +++ b/packages/webapp/src/game/fableProofs.ts @@ -6,8 +6,8 @@ * @module game/fableProofs */ -import { packBytes } from "src/utils/zkproofs/proofs" import { FELT_SIZE, NUM_FELTS_FOR_CARDS } from "src/game/constants" +import { packBytes } from "src/utils/zkproofs/proofs" // ================================================================================================= diff --git a/packages/webapp/src/game/misc.ts b/packages/webapp/src/game/misc.ts index e6ce7af7..6f80f403 100644 --- a/packages/webapp/src/game/misc.ts +++ b/packages/webapp/src/game/misc.ts @@ -1,8 +1,8 @@ /** * Misc game logic helpers. */ -import { FetchedGameData, GameStep } from "src/store/types" import { Address } from "src/chain" +import { FetchedGameData, GameStep } from "src/store/types" // ================================================================================================= diff --git a/packages/webapp/src/hooks/useCancellationHandler.ts b/packages/webapp/src/hooks/useCancellationHandler.ts index da193ef5..fcce13fd 100644 --- a/packages/webapp/src/hooks/useCancellationHandler.ts +++ b/packages/webapp/src/hooks/useCancellationHandler.ts @@ -4,9 +4,10 @@ * @module hooks/useCancellationHandler */ -import { CancellationHandler } from "src/components/modals/loadingModal" import { useEffect, useRef } from "react" +import { CancellationHandler } from "src/components/modals/loadingModal" + // ================================================================================================= /** diff --git a/packages/webapp/src/hooks/useChainWrite.ts b/packages/webapp/src/hooks/useChainWrite.ts index 2e24a8bc..5f55f380 100644 --- a/packages/webapp/src/hooks/useChainWrite.ts +++ b/packages/webapp/src/hooks/useChainWrite.ts @@ -1,6 +1,6 @@ -import { useContractWrite, usePrepareContractWrite, useWaitForTransaction } from "wagmi" -import { type TransactionReceipt } from "viem" import { Address, Hash } from "src/chain" +import { type TransactionReceipt } from "viem" +import { useContractWrite, usePrepareContractWrite, useWaitForTransaction } from "wagmi" // ================================================================================================= diff --git a/packages/webapp/src/hooks/useDebug.ts b/packages/webapp/src/hooks/useDebug.ts index 1abb1621..41e940a5 100644 --- a/packages/webapp/src/hooks/useDebug.ts +++ b/packages/webapp/src/hooks/useDebug.ts @@ -1,4 +1,5 @@ import { useDebugValue, useState } from "react" + import { toString } from "src/utils/js-utils" // ------------------------------------------------------------------------------------------------- diff --git a/packages/webapp/src/hooks/useDragEvents.ts b/packages/webapp/src/hooks/useDragEvents.ts index f5ded6c7..91c26a0e 100644 --- a/packages/webapp/src/hooks/useDragEvents.ts +++ b/packages/webapp/src/hooks/useDragEvents.ts @@ -1,10 +1,11 @@ -import { DragStartEvent, DragEndEvent, UniqueIdentifier } from "@dnd-kit/core" +import { useCallback } from "react" + +import { DragEndEvent, DragStartEvent, UniqueIdentifier } from "@dnd-kit/core" +import { playCard } from "src/actions/playCard" +import { CancellationHandler } from "src/components/modals/loadingModal" import * as store from "src/store/hooks" import { CardPlacement } from "src/store/types" -import { useCallback } from "react" import { extractCardID } from "src/utils/js-utils" -import { CancellationHandler } from "src/components/modals/loadingModal" -import { playCard } from "src/actions/playCard" function useDragEvents( setActiveId: (id: UniqueIdentifier | null) => void, diff --git a/packages/webapp/src/hooks/useFableWrite.ts b/packages/webapp/src/hooks/useFableWrite.ts index 13441ed7..753a6781 100644 --- a/packages/webapp/src/hooks/useFableWrite.ts +++ b/packages/webapp/src/hooks/useFableWrite.ts @@ -1,10 +1,8 @@ -import { type TransactionReceipt } from "viem" - +import { Hash } from "src/chain" import { deployment } from "src/deployment" import { cardsCollectionABI, deckAirdropABI, gameABI, inventoryABI } from "src/generated" import { useChainWrite, UseWriteResult } from "src/hooks/useChainWrite" - -import { Hash } from "src/chain" +import { type TransactionReceipt } from "viem" // ================================================================================================= // useWrite: just `useWrite` with the contract address and ABI already set. diff --git a/packages/webapp/src/pages/_app.tsx b/packages/webapp/src/pages/_app.tsx index 792fb2d4..17f69620 100644 --- a/packages/webapp/src/pages/_app.tsx +++ b/packages/webapp/src/pages/_app.tsx @@ -1,22 +1,25 @@ // ================================================================================================= // Must come first, so that can we can hook global members before they're used by imports. -import "src/setup" -import "src/store/setup" -import { ConnectKitProvider } from "connectkit" +import { ComponentType, useEffect } from "react" import { NextPage } from "next" import type { AppType } from "next/app" import Head from "next/head" -import { useAccount, WagmiConfig } from "wagmi" +import { useRouter } from "next/router" + +import { ConnectKitProvider } from "connectkit" import { ensureLocalAccountIndex, wagmiConfig } from "src/chain" import jotaiDebug from "src/components/lib/jotaiDebug" import { GlobalErrorModal } from "src/components/modals/globalErrorModal" +import { Toaster } from "src/components/ui/sonner" import { useIsHydrated } from "src/hooks/useIsHydrated" import { useErrorConfig } from "src/store/hooks" +import { useAccount, WagmiConfig } from "wagmi" + import "src/styles/globals.css" -import { useRouter } from "next/router" -import { ComponentType, useEffect } from "react" -import { Toaster } from "src/components/ui/sonner" + +import "src/setup" +import "src/store/setup" // ================================================================================================= diff --git a/packages/webapp/src/pages/collection.tsx b/packages/webapp/src/pages/collection.tsx index 43439324..4eede447 100644 --- a/packages/webapp/src/pages/collection.tsx +++ b/packages/webapp/src/pages/collection.tsx @@ -1,23 +1,21 @@ -import debounce from "lodash/debounce" +import React, { useEffect,useMemo, useState } from "react" import Head from "next/head" +import { useRouter } from "next/router" -import React, { useState, useMemo, useEffect } from "react" -import { useAccount } from "wagmi" - +import debounce from "lodash/debounce" +import { Address } from "src/chain" +import CardCollectionDisplay from "src/components/collection/cardCollectionDisplay" +import DeckList from "src/components/collection/deckList" +import DeckPanel from "src/components/collection/deckPanel" +import FilterPanel from "src/components/collection/filterPanel" import jotaiDebug from "src/components/lib/jotaiDebug" import { Navbar } from "src/components/navbar" import { deployment } from "src/deployment" import { useInventoryCardsCollectionGetCollection } from "src/generated" -import { Deck, Card } from "src/store/types" -import { Address } from "src/chain" import { FablePage } from "src/pages/_app" -import { useRouter } from "next/router" +import { Card,Deck } from "src/store/types" import { navigate } from "utils/navigate" - -import FilterPanel from "src/components/collection/filterPanel" -import CardCollectionDisplay from "src/components/collection/cardCollectionDisplay" -import DeckList from "src/components/collection/deckList" -import DeckPanel from "src/components/collection/deckPanel" +import { useAccount } from "wagmi" // NOTE(norswap & geniusgarlic): Just an example, when the game actually has effects & types, // fetch those from the chain instead of hardcoding them here. diff --git a/packages/webapp/src/pages/index.tsx b/packages/webapp/src/pages/index.tsx index e81dcd4f..6f6578d3 100644 --- a/packages/webapp/src/pages/index.tsx +++ b/packages/webapp/src/pages/index.tsx @@ -1,16 +1,15 @@ import { ConnectKitButton, useModal } from "connectkit" -import { useAccount, useNetwork } from "wagmi" - import { Address, chains } from "src/chain" -import { deployment } from "src/deployment" +import Link from "src/components/link" import { CreateGameModal } from "src/components/modals/createGameModal" import { JoinGameModal } from "src/components/modals/joinGameModal" import { MintDeckModal } from "src/components/modals/mintDeckModal" +import { Button } from "src/components/ui/button" +import { deployment } from "src/deployment" import { useGameInGame } from "src/generated" import { FablePage } from "src/pages/_app" import { useGameID } from "src/store/hooks" -import { Button } from "src/components/ui/button" -import Link from "src/components/link" +import { useAccount, useNetwork } from "wagmi" const Home: FablePage = ({ isHydrated }) => { const { address } = useAccount() diff --git a/packages/webapp/src/pages/play.tsx b/packages/webapp/src/pages/play.tsx index 007f7660..045d53e1 100644 --- a/packages/webapp/src/pages/play.tsx +++ b/packages/webapp/src/pages/play.tsx @@ -1,44 +1,44 @@ import { useCallback, useEffect, useState } from "react" - -import Hand from "src/components/hand" -import { LoadingModal } from "src/components/modals/loadingModal" -import { GameEndedModal } from "src/components/modals/gameEndedModal" -import { Navbar } from "src/components/navbar" -import * as store from "src/store/hooks" -import { CardPlacement, GameStatus, GameStep } from "src/store/types" -import { FablePage } from "src/pages/_app" -import { Address } from "viem" -import { readContract } from "wagmi/actions" -import { deployment } from "src/deployment" -import { gameABI } from "src/generated" +import { createPortal } from "react-dom" import { useRouter } from "next/router" -import { setError } from "src/store/write" -import { DISMISS_BUTTON } from "src/actions/errors" -import { navigate } from "src/utils/navigate" -import { concede } from "src/actions/concede" -import { drawCard } from "src/actions/drawCard" -import { endTurn } from "src/actions/endTurn" -import { currentPlayer, isEndingTurn } from "src/game/misc" -import { useCancellationHandler } from "src/hooks/useCancellationHandler" -import { usePlayerHand } from "src/store/hooks" + import { + closestCenter, + defaultDropAnimationSideEffects, DndContext, DragOverlay, DropAnimation, MeasuringStrategy, MouseSensor, UniqueIdentifier, - closestCenter, - defaultDropAnimationSideEffects, useSensor, useSensors, } from "@dnd-kit/core" -import PlayerBoard from "src/components/playerBoard" -import { createPortal } from "react-dom" -import useDragEvents from "src/hooks/useDragEvents" +import { toast } from "sonner" +import { concede } from "src/actions/concede" +import { drawCard } from "src/actions/drawCard" +import { endTurn } from "src/actions/endTurn" +import { DISMISS_BUTTON } from "src/actions/errors" import CardContainer from "src/components/cards/cardContainer" +import Hand from "src/components/hand" +import { GameEndedModal } from "src/components/modals/gameEndedModal" +import { LoadingModal } from "src/components/modals/loadingModal" +import { Navbar } from "src/components/navbar" +import PlayerBoard from "src/components/playerBoard" import { Button } from "src/components/ui/button" -import { toast } from "sonner" +import { deployment } from "src/deployment" +import { currentPlayer, isEndingTurn } from "src/game/misc" +import { gameABI } from "src/generated" +import { useCancellationHandler } from "src/hooks/useCancellationHandler" +import useDragEvents from "src/hooks/useDragEvents" +import { FablePage } from "src/pages/_app" +import * as store from "src/store/hooks" +import { usePlayerHand } from "src/store/hooks" +import { CardPlacement, GameStatus, GameStep } from "src/store/types" +import { setError } from "src/store/write" +import { navigate } from "src/utils/navigate" +import { Address } from "viem" +import { readContract } from "wagmi/actions" const Play: FablePage = ({ isHydrated }) => { const [gameID, setGameID] = store.useGameID() diff --git a/packages/webapp/src/store/atoms.ts b/packages/webapp/src/store/atoms.ts index 00c072a8..fa24bfe1 100644 --- a/packages/webapp/src/store/atoms.ts +++ b/packages/webapp/src/store/atoms.ts @@ -8,8 +8,8 @@ */ import { atom, getDefaultStore } from "jotai" -import { Address } from "src/chain" import { atomWithStorage } from "jotai/utils" +import { Address } from "src/chain" import * as derive from "src/store/derive" import type { ErrorConfig, FetchedGameData, PlayerData, PrivateInfo, PrivateInfoStore } from "src/store/types" import { GameStatus } from "src/store/types" diff --git a/packages/webapp/src/store/hooks.ts b/packages/webapp/src/store/hooks.ts index 65d36ea3..7a1a6a9c 100644 --- a/packages/webapp/src/store/hooks.ts +++ b/packages/webapp/src/store/hooks.ts @@ -8,7 +8,6 @@ */ import { useAtom, useAtomValue } from "jotai" - import { Address } from "src/chain" import * as store from "src/store/atoms" import { ErrorConfig, FetchedGameData, GameStatus, PlayerData, PrivateInfo } from "src/store/types" diff --git a/packages/webapp/src/store/network.ts b/packages/webapp/src/store/network.ts index 6d9c1eaf..980b188f 100644 --- a/packages/webapp/src/store/network.ts +++ b/packages/webapp/src/store/network.ts @@ -5,13 +5,12 @@ * @module store/network */ -import { readContract } from "wagmi/actions" - -import { gameABI, inventoryABI } from "src/generated" +import { type Address } from "src/chain" import { deployment } from "src/deployment" -import { type Fetched, throttledFetch } from "src/utils/throttledFetch" +import { gameABI, inventoryABI } from "src/generated" import { type FetchedGameData } from "src/store/types" -import { type Address } from "src/chain" +import { type Fetched, throttledFetch } from "src/utils/throttledFetch" +import { readContract } from "wagmi/actions" // ================================================================================================= diff --git a/packages/webapp/src/store/setup.ts b/packages/webapp/src/store/setup.ts index 9216e13d..5be957b8 100644 --- a/packages/webapp/src/store/setup.ts +++ b/packages/webapp/src/store/setup.ts @@ -7,11 +7,10 @@ * @module store/setup */ -import { getAccount, watchAccount, watchNetwork } from "wagmi/actions" - +import { GAME_DATA_REFRESH_INTERVAL } from "src/constants" import * as store from "src/store/atoms" import { gameIDListener, refreshGameData, updateNetwork, updatePlayerAddress } from "src/store/update" -import { GAME_DATA_REFRESH_INTERVAL } from "src/constants" +import { getAccount, watchAccount, watchNetwork } from "wagmi/actions" // ================================================================================================= diff --git a/packages/webapp/src/store/subscriptions.ts b/packages/webapp/src/store/subscriptions.ts index 03087dcf..a55b6e2a 100644 --- a/packages/webapp/src/store/subscriptions.ts +++ b/packages/webapp/src/store/subscriptions.ts @@ -11,16 +11,15 @@ // ================================================================================================= -import { Log } from "viem" -import { getPublicClient } from "wagmi/actions" - +import { DISMISS_BUTTON } from "src/actions/errors" import { deployment } from "src/deployment" import { gameABI } from "src/generated" import * as store from "src/store/atoms" import { refreshGameData } from "src/store/update" -import { format } from "src/utils/js-utils" import { setError } from "src/store/write" -import { DISMISS_BUTTON } from "src/actions/errors" +import { format } from "src/utils/js-utils" +import { Log } from "viem" +import { getPublicClient } from "wagmi/actions" // ================================================================================================= // SUBSCRIPTION MANAGEMENT diff --git a/packages/webapp/src/store/update.ts b/packages/webapp/src/store/update.ts index 7b38eea7..ad175a70 100644 --- a/packages/webapp/src/store/update.ts +++ b/packages/webapp/src/store/update.ts @@ -6,22 +6,21 @@ // ================================================================================================= -import { getBlock } from "viem/actions" -import { getAccount, getNetwork, getPublicClient } from "wagmi/actions" - +import { contractWriteThrowing } from "src/actions/libContractWrite" import { AccountResult, Address, chains, NetworkResult, ZeroHash } from "src/chain" -import { subscribeToGame } from "src/store/subscriptions" +import { deployment } from "src/deployment" +import { PROOF_CURVE_ORDER } from "src/game/constants" +import { gameABI } from "src/generated" import * as store from "src/store/atoms" import * as net from "src/store/network" -import { THROTTLED, ZOMBIE } from "src/utils/throttledFetch" -import { formatTimestamp, parseBigInt } from "src/utils/js-utils" +import { getGameStatus, getPlayerData } from "src/store/read" +import { subscribeToGame } from "src/store/subscriptions" import { FetchedGameData, GameStatus } from "src/store/types" import { setError } from "src/store/write" -import { contractWriteThrowing } from "src/actions/libContractWrite" -import { deployment } from "src/deployment" -import { gameABI } from "src/generated" -import { PROOF_CURVE_ORDER } from "src/game/constants" -import { getGameStatus, getPlayerData } from "src/store/read" +import { formatTimestamp, parseBigInt } from "src/utils/js-utils" +import { THROTTLED, ZOMBIE } from "src/utils/throttledFetch" +import { getBlock } from "viem/actions" +import { getAccount, getNetwork, getPublicClient } from "wagmi/actions" // ================================================================================================= // CHANGE LISTENERS diff --git a/packages/webapp/src/store/write.ts b/packages/webapp/src/store/write.ts index 287b0646..27990683 100644 --- a/packages/webapp/src/store/write.ts +++ b/packages/webapp/src/store/write.ts @@ -5,13 +5,13 @@ */ import { Address } from "src/chain" +import { PROOF_CURVE_ORDER } from "src/game/constants" import * as store from "src/store/atoms" import { ErrorConfig, PrivateInfo } from "src/store/types" +import { mimcHash } from "src/utils/hashing" import { randomUint256 } from "src/utils/js-utils" import "src/utils/extensions" -import { mimcHash } from "src/utils/hashing" -import { PROOF_CURVE_ORDER } from "src/game/constants" const get = store.get const set = store.set diff --git a/packages/webapp/src/utils/jotai.ts b/packages/webapp/src/utils/jotai.ts index 880d62d7..539b8898 100644 --- a/packages/webapp/src/utils/jotai.ts +++ b/packages/webapp/src/utils/jotai.ts @@ -4,7 +4,7 @@ * @module utils/jotai */ -import { atom, Atom } from "jotai" +import { Atom, atom } from "jotai" import { isEqual } from "lodash" // ================================================================================================= diff --git a/packages/webapp/src/utils/react-utils.ts b/packages/webapp/src/utils/react-utils.ts index 29cbc070..75c27b6d 100644 --- a/packages/webapp/src/utils/react-utils.ts +++ b/packages/webapp/src/utils/react-utils.ts @@ -6,7 +6,7 @@ // ================================================================================================= -import { atom, type Atom, type Getter, type Setter, type WritableAtom } from "jotai" +import { type Atom, atom, type Getter, type Setter, type WritableAtom } from "jotai" // ================================================================================================= // Recreating (simplified) Jotai types diff --git a/packages/webapp/src/utils/zkproofs/proofWorker.ts b/packages/webapp/src/utils/zkproofs/proofWorker.ts index 27f983f8..1d7c42ea 100644 --- a/packages/webapp/src/utils/zkproofs/proofWorker.ts +++ b/packages/webapp/src/utils/zkproofs/proofWorker.ts @@ -4,7 +4,7 @@ * Used from {@link proveInWorker}. */ -import { prove, type ProofInputs } from "src/utils/zkproofs/proofs" +import { type ProofInputs,prove } from "src/utils/zkproofs/proofs" // ================================================================================================= diff --git a/packages/webapp/src/utils/zkproofs/proofs.ts b/packages/webapp/src/utils/zkproofs/proofs.ts index fa97eb4a..4b957b7c 100644 --- a/packages/webapp/src/utils/zkproofs/proofs.ts +++ b/packages/webapp/src/utils/zkproofs/proofs.ts @@ -4,8 +4,8 @@ * @module utils/zkproofs/proofs */ -import { formatTimestamp } from "src/utils/js-utils" import { TimeoutError } from "src/utils/errors" +import { formatTimestamp } from "src/utils/js-utils" // eslint-disable-next-line @typescript-eslint/no-var-requires const snarkjs = require("snarkjs") diff --git a/packages/webapp/src/wagmi/BurnerConnector.ts b/packages/webapp/src/wagmi/BurnerConnector.ts index 4203f05e..0fc6d602 100644 --- a/packages/webapp/src/wagmi/BurnerConnector.ts +++ b/packages/webapp/src/wagmi/BurnerConnector.ts @@ -2,13 +2,13 @@ * Implementation of a Wagmi connector for a private key held in local browser storage. */ -import { Connector, ConnectorData, WalletClient } from "wagmi" import { Address } from "src/chain" -import { PrivateKeyAccount, privateKeyToAccount } from "viem/accounts" +import { AsyncLock } from "src/utils/asyncLock" import { createWalletClient, http } from "viem" -import { localhost } from "wagmi/chains" +import { PrivateKeyAccount, privateKeyToAccount } from "viem/accounts" +import { Connector, ConnectorData, WalletClient } from "wagmi" import { connect, disconnect, getAccount } from "wagmi/actions" -import { AsyncLock } from "src/utils/asyncLock" +import { localhost } from "wagmi/chains" // ================================================================================================= diff --git a/packages/webapp/wagmi.config.ts b/packages/webapp/wagmi.config.ts index 99988a41..efbfea49 100644 --- a/packages/webapp/wagmi.config.ts +++ b/packages/webapp/wagmi.config.ts @@ -1,6 +1,5 @@ import { defineConfig } from "@wagmi/cli" -import { react } from "@wagmi/cli/plugins" -import { foundry } from "@wagmi/cli/plugins" +import { foundry,react } from "@wagmi/cli/plugins" export default defineConfig({ out: "src/generated.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec1e6f2a..94483294 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,9 +96,6 @@ importers: connectkit: specifier: ^1.5.3 version: 1.5.3(@babel/core@7.23.2)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.16.6)(wagmi@1.4.5) - eslint-config-prettier: - specifier: ^9.1.0 - version: 9.1.0(eslint@8.52.0) jotai: specifier: ^2.4.3 version: 2.4.3(@types/react@18.2.31)(react@18.2.0) @@ -190,6 +187,15 @@ importers: eslint-config-next: specifier: ^13.5.6 version: 13.5.6(eslint@8.52.0)(typescript@5.2.2) + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.0(eslint@8.52.0) + eslint-plugin-import: + specifier: ^2.29.1 + version: 2.29.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) + eslint-plugin-simple-import-sort: + specifier: ^12.0.0 + version: 12.0.0(eslint@8.52.0) postcss: specifier: ^8.4.31 version: 8.4.31 @@ -208,6 +214,7 @@ packages: /@aashutoshrathi/word-wrap@1.2.6: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} + dev: true /@adraffy/ens-normalize@1.10.0: resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} @@ -1933,10 +1940,12 @@ packages: dependencies: eslint: 8.52.0 eslint-visitor-keys: 3.4.3 + dev: true /@eslint-community/regexpp@4.10.0: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true /@eslint/eslintrc@2.1.2: resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} @@ -1953,10 +1962,12 @@ packages: strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color + dev: true /@eslint/js@8.52.0: resolution: {integrity: sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true /@ethersproject/abi@5.7.0: resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} @@ -2340,13 +2351,16 @@ packages: minimatch: 3.1.2 transitivePeerDependencies: - supports-color + dev: true /@humanwhocodes/module-importer@1.0.1: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} + dev: true /@humanwhocodes/object-schema@2.0.1: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} + dev: true /@iden3/bigarray@0.0.2: resolution: {integrity: sha512-Xzdyxqm1bOFF6pdIsiHLLl3HkSLjbhqJHVyqaTxXt3RqXBEnmsUmEW47H7VOi/ak7TdkRpNkxjyK5Zbkm+y52g==} @@ -4346,6 +4360,7 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + dev: true /@viem/anvil@0.0.5(debug@4.3.4): resolution: {integrity: sha512-aGgbwBNmCcxp08WcYwyL+n01HLLFYuhIczQLy6BPcomQ2CG4ngfTed8K73EOpsBTmvCxAcek0APcVS7UUWNALw==} @@ -5003,11 +5018,13 @@ packages: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: acorn: 8.11.2 + dev: true /acorn@8.11.2: resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} engines: {node: '>=0.4.0'} hasBin: true + dev: true /aes-js@3.0.0: resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} @@ -5069,6 +5086,7 @@ packages: fast-json-stable-stringify: 2.1.0 json-schema-traverse: 0.4.1 uri-js: 4.4.1 + dev: true /ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} @@ -5185,6 +5203,7 @@ packages: /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true /aria-hidden@1.2.3: resolution: {integrity: sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==} @@ -6503,6 +6522,7 @@ packages: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 + dev: true /css-color-keywords@1.0.0: resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} @@ -6925,6 +6945,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 + dev: true /dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} @@ -7311,8 +7332,8 @@ packages: '@typescript-eslint/parser': 6.8.0(eslint@8.52.0)(typescript@5.2.2) eslint: 8.52.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.52.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.52.0) eslint-plugin-react: 7.33.2(eslint@8.52.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.52.0) @@ -7329,7 +7350,7 @@ packages: eslint: '>=7.0.0' dependencies: eslint: 8.52.0 - dev: false + dev: true /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} @@ -7341,7 +7362,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.52.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -7352,7 +7373,7 @@ packages: enhanced-resolve: 5.15.0 eslint: 8.52.0 eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -7389,13 +7410,13 @@ packages: debug: 3.2.7(supports-color@8.1.1) eslint: 8.52.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.52.0) transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0): - resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0): + resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -7422,7 +7443,7 @@ packages: object.groupby: 1.0.1 object.values: 1.1.7 semver: 6.3.1 - tsconfig-paths: 3.14.2 + tsconfig-paths: 3.15.0 transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -7488,6 +7509,14 @@ packages: string.prototype.matchall: 4.0.10 dev: true + /eslint-plugin-simple-import-sort@12.0.0(eslint@8.52.0): + resolution: {integrity: sha512-8o0dVEdAkYap0Cn5kNeklaKcT1nUsa3LITWEuFk3nJifOoD+5JQGoyDUW2W/iPWwBsNBJpyJS9y4je/BgxLcyQ==} + peerDependencies: + eslint: '>=5.0.0' + dependencies: + eslint: 8.52.0 + dev: true + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -7502,10 +7531,12 @@ packages: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 + dev: true /eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true /eslint@8.52.0: resolution: {integrity: sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==} @@ -7552,6 +7583,7 @@ packages: text-table: 0.2.0 transitivePeerDependencies: - supports-color + dev: true /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} @@ -7560,6 +7592,7 @@ packages: acorn: 8.11.2 acorn-jsx: 5.3.2(acorn@8.11.2) eslint-visitor-keys: 3.4.3 + dev: true /esprima@1.2.2: resolution: {integrity: sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==} @@ -7577,12 +7610,14 @@ packages: engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 + dev: true /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} dependencies: estraverse: 5.3.0 + dev: true /estraverse@4.3.0: resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} @@ -7591,6 +7626,7 @@ packages: /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + dev: true /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} @@ -7879,6 +7915,7 @@ packages: /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true /fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} @@ -7896,6 +7933,7 @@ packages: /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true /fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} @@ -7966,6 +8004,7 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} dependencies: flat-cache: 3.1.1 + dev: true /file-type@11.1.0: resolution: {integrity: sha512-rM0UO7Qm9K7TWTtA6AShI/t7H5BPjDeGVDaNyg9BjHAj3PysKy7+8C8D137R88jnR3rFJZQB/tFgydl5sN5m7g==} @@ -8090,6 +8129,7 @@ packages: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 + dev: true /find-up@6.3.0: resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} @@ -8106,6 +8146,7 @@ packages: flatted: 3.2.9 keyv: 4.5.4 rimraf: 3.0.2 + dev: true /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} @@ -8114,6 +8155,7 @@ packages: /flatted@3.2.9: resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} + dev: true /follow-redirects@1.15.3(debug@4.3.4): resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} @@ -8437,6 +8479,7 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + dev: true /glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} @@ -8465,6 +8508,7 @@ packages: engines: {node: '>=8'} dependencies: type-fest: 0.20.2 + dev: true /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} @@ -8554,6 +8598,7 @@ packages: /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true /handle-thing@2.0.1: resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} @@ -8855,6 +8900,7 @@ packages: /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} + dev: true /immutable@4.3.4: resolution: {integrity: sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==} @@ -8879,6 +8925,7 @@ packages: /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + dev: true /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} @@ -9089,6 +9136,7 @@ packages: /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} + dev: true /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} @@ -9228,6 +9276,7 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true /isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} @@ -9902,6 +9951,7 @@ packages: hasBin: true dependencies: argparse: 2.0.1 + dev: true /jsbn@0.1.1: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} @@ -9923,6 +9973,7 @@ packages: /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} @@ -9939,6 +9990,7 @@ packages: /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true /json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} @@ -9950,6 +10002,7 @@ packages: /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} @@ -10041,6 +10094,7 @@ packages: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} dependencies: json-buffer: 3.0.1 + dev: true /keyvaluestorage-interface@1.0.0: resolution: {integrity: sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==} @@ -10096,6 +10150,7 @@ packages: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 + dev: true /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} @@ -10178,6 +10233,7 @@ packages: engines: {node: '>=10'} dependencies: p-locate: 5.0.0 + dev: true /locate-path@7.2.0: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} @@ -10215,6 +10271,7 @@ packages: /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true /lodash.once@4.1.1: resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} @@ -10486,6 +10543,7 @@ packages: /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true /negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} @@ -10846,6 +10904,7 @@ packages: levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 + dev: true /ora@6.3.1: resolution: {integrity: sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==} @@ -10904,6 +10963,7 @@ packages: engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 + dev: true /p-limit@4.0.0: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} @@ -10923,6 +10983,7 @@ packages: engines: {node: '>=10'} dependencies: p-limit: 3.1.0 + dev: true /p-locate@6.0.0: resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} @@ -11036,6 +11097,7 @@ packages: /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + dev: true /path-key@4.0.0: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} @@ -11252,6 +11314,7 @@ packages: /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + dev: true /prepend-http@2.0.0: resolution: {integrity: sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==} @@ -11445,6 +11508,7 @@ packages: /punycode@2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} + dev: true /pure-rand@6.0.4: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} @@ -11980,6 +12044,7 @@ packages: hasBin: true dependencies: glob: 7.2.3 + dev: true /rpc-websockets@7.6.1: resolution: {integrity: sha512-MmRGaJJvxTHSRxYPjJJqcj2zWnCetw7YbYbKlD0Yc7qVw6PsZhRJg1MI3mpWlpBs+4zO+urlNfLl9zLsdOD/gA==} @@ -12222,10 +12287,12 @@ packages: engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 + dev: true /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + dev: true /shell-quote@1.8.1: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} @@ -12658,6 +12725,7 @@ packages: /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + dev: true /strip-outer@1.0.1: resolution: {integrity: sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==} @@ -12903,6 +12971,7 @@ packages: /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} @@ -13010,8 +13079,8 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - /tsconfig-paths@3.14.2: - resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} + /tsconfig-paths@3.15.0: + resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} dependencies: '@types/json5': 0.0.29 json5: 1.0.2 @@ -13051,6 +13120,7 @@ packages: engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.2.1 + dev: true /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} @@ -13060,6 +13130,7 @@ packages: /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} + dev: true /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} @@ -13233,6 +13304,7 @@ packages: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.0 + dev: true /url-parse-lax@3.0.0: resolution: {integrity: sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==} @@ -13741,6 +13813,7 @@ packages: hasBin: true dependencies: isexe: 2.0.0 + dev: true /wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} @@ -13944,6 +14017,7 @@ packages: /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + dev: true /yocto-queue@1.0.0: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}