-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: Change to V1 + add type aliases for entity ids #1148
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
…ns + fix z-index of quests, guilds and leaderboard
* contract: limit armies and enable deletion * contracts: delete army if merging kills troop * upgrade to dojov1.0.0-alpha.1 * upgrade to dojov1.0.0-alpha.1 * scarb fmt * update tests * update tests && scarb fmt * update test utils * update test utils * update test utils * update test utils * fix inaccurate winner invariant error * add tool-versions * contracts: basic army create tests * contracts: basic army buy tests * fix reward calculation bug * more combat tests * combat: reward bug fix * scarb fmt * Merge branch 'v1' of https://github.com/BibliothecaDAO/eternum into combat-tests * update workflow * update lockfile * update workflow * update workflow * update lockfile * update lock file * bump to alpha 2 * update to cairo 2.7.0 * contracts: update workflow to print resource usage * update workflow * contracts: use u32 as primary id * contracts: use u32 as primary id in tests * update config and manifests * contracts: optimization: use IntrospectPacked * - remove introspectpacked from models with enum - use id alias more * Clean/legacy (#1146) * Clean legacy code + remove unused exports * add knip command * more cleaning * prettier * Cleanup + add knip CI * fix build * fix knip * rebase main * prettier * fix knip ci * resolve comments * feat: Change to V1 + add type aliases for entity ids (#1148) * Change to V1 + add type aliases for entity ids * Make elements clickable under right and left navigation modules buttons + fix z-index of quests, guilds and leaderboard * scarb fmt * Change bonus_percent to u32 instead of u128 * Address minor PR comments * prettier * knip --------- Co-authored-by: ponderingdemocritus <[email protected]> Co-authored-by: tedison <[email protected]> Co-authored-by: Constantin Wastchenko <[email protected]> Co-authored-by: tedison <[email protected]>
PR Type
enhancement, other
Description
contractComponents.ts
to use new naming conventions and updated types.NAMESPACE
constant and updated contract retrieval functions inEternumProvider
to use the namespace.ContractAddress
andID
across multiple files for better type safety.Changes walkthrough 📝
7 files
contractComponents.ts
Refactor component definitions and update types
client/src/dojo/contractComponents.ts
index.ts
Add namespace handling and update contract retrieval
sdk/packages/eternum/src/provider/index.ts
NAMESPACE
constant.getContractByName
function to usetag
instead ofname
.NAMESPACE
.useStructures.tsx
Add type aliases and update structure hooks
client/src/hooks/helpers/useStructures.tsx
ContractAddress
andID
.useStructuresPosition
function.useArmies.tsx
Add type aliases and update army hooks
client/src/hooks/helpers/useArmies.tsx
ContractAddress
andID
.useArmiesByBattleId
function.useResources.tsx
Add type aliases and update resource hooks
client/src/hooks/helpers/useResources.tsx
ContractAddress
andID
.useEntities.tsx
Add type aliases and update entity hooks
client/src/hooks/helpers/useEntities.tsx
ContractAddress
andID
.PillageHistory.tsx
Add type alias and update pillage history component
client/src/ui/components/military/PillageHistory.tsx
ID
.108 files
useQuests.tsx
...
client/src/hooks/helpers/useQuests.tsx
...
useRealm.tsx
...
client/src/hooks/helpers/useRealm.tsx
...
__mock__.ts
...
client/src/dojo/modelManager/tests/mock.ts
...
BattleManager.test.ts
...
client/src/dojo/modelManager/tests/BattleManager.test.ts
...
useGuilds.tsx
...
client/src/hooks/helpers/useGuilds.tsx
...
useBattles.tsx
...
client/src/hooks/helpers/battles/useBattles.tsx
...
useLeaderBoardStore.tsx
...
client/src/hooks/store/useLeaderBoardStore.tsx
...
useTrade.tsx
...
client/src/hooks/helpers/useTrade.tsx
...
ProductionManager.ts
...
client/src/dojo/modelManager/ProductionManager.ts
...
_mapStore.tsx
...
client/src/hooks/store/_mapStore.tsx
...
useHyperstructures.tsx
...
client/src/hooks/helpers/useHyperstructures.tsx
...
useStamina.tsx
...
client/src/hooks/helpers/useStamina.tsx
...
common.ts
...
sdk/packages/eternum/src/types/common.ts
...
useBuildings.tsx
...
client/src/hooks/helpers/useBuildings.tsx
...
utils.tsx
...
client/src/ui/utils/utils.tsx
...
BattleView.tsx
...
client/src/ui/modules/military/battle-view/BattleView.tsx
...
BattleActions.tsx
...
client/src/ui/modules/military/battle-view/BattleActions.tsx
...
BattleManager.ts
...
client/src/dojo/modelManager/BattleManager.ts
...
GuildInvites.tsx
...
client/src/ui/components/worldmap/guilds/GuildInvites.tsx
...
TopMiddleNavigation.tsx
...
client/src/ui/modules/navigation/TopMiddleNavigation.tsx
...
BattleSideView.tsx
...
client/src/ui/modules/military/battle-view/BattleSideView.tsx
...
MarketOrderPanel.tsx
...
client/src/ui/components/trading/MarketOrderPanel.tsx
...
TransferBetweenEntities.tsx
...
client/src/ui/components/trading/TransferBetweenEntities.tsx
...
Swap.tsx
...
client/src/ui/components/bank/Swap.tsx
...
WorldStructuresMenu.tsx
...
client/src/ui/modules/world-structures/WorldStructuresMenu.tsx
...
SelectPreviewBuilding.tsx
...
client/src/ui/components/construction/SelectPreviewBuilding.tsx
...
StructureCard.tsx
...
client/src/ui/components/hyperstructures/StructureCard.tsx
...
LiquidityResourceRow.tsx
...
client/src/ui/components/bank/LiquidityResourceRow.tsx
...
TradeHistoryEvent.tsx
...
client/src/ui/components/trading/TradeHistoryEvent.tsx
...
AddLiquidity.tsx
...
client/src/ui/components/bank/AddLiquidity.tsx
...
MarketManager.ts
...
client/src/dojo/modelManager/MarketManager.ts
...
realms.tsx
...
client/src/ui/utils/realms.tsx
...
Guilds.tsx
...
client/src/ui/components/worldmap/guilds/Guilds.tsx
...
useTravel.tsx
...
client/src/hooks/helpers/useTravel.tsx
...
SelectLocationPanel.tsx
...
client/src/ui/components/entities/SelectLocationPanel.tsx
...
useRealmStore.tsx
...
client/src/hooks/store/useRealmStore.tsx
...
EntityDetails.tsx
...
client/src/ui/modules/entity-details/EntityDetails.tsx
...
createUpdates.ts
...
client/src/dojo/createUpdates.ts
...
Entity.tsx
...
client/src/ui/components/entities/Entity.tsx
...
GuildMembers.tsx
...
client/src/ui/components/worldmap/guilds/GuildMembers.tsx
...
ResourceBar.tsx
...
client/src/ui/components/bank/ResourceBar.tsx
...
MarketModal.tsx
...
client/src/ui/components/trading/MarketModal.tsx
...
useExplore.tsx
...
client/src/hooks/helpers/useExplore.tsx
...
ArmyManagementCard.tsx
...
client/src/ui/components/military/ArmyManagementCard.tsx
...
MarketTradingHistory.tsx
...
client/src/ui/components/trading/MarketTradingHistory.tsx
...
ExistingBuildings.tsx
...
client/src/ui/components/construction/ExistingBuildings.tsx
...
Battle.tsx
...
client/src/ui/modules/military/battle-view/Battle.tsx
...
Steps.tsx
...
client/src/ui/modules/onboarding/Steps.tsx
...
ArmyInfoLabel.tsx
...
client/src/ui/components/worldmap/armies/ArmyInfoLabel.tsx
...
DepositResources.tsx
...
client/src/ui/components/resources/DepositResources.tsx
...
useMarketStore.tsx
...
client/src/hooks/store/useMarketStore.tsx
...
StaminaResource.tsx
...
client/src/ui/elements/StaminaResource.tsx
...
useEventHandlers.tsx
...
client/src/ui/components/worldmap/hexagon/useEventHandlers.tsx
...
useContributions.tsx
...
client/src/hooks/helpers/useContributions.tsx
...
ArmyList.tsx
...
client/src/ui/components/military/ArmyList.tsx
...
Structures.tsx
...
client/src/ui/components/models/buildings/worldmap/Structures.tsx
...
StructureListItem.tsx
...
client/src/ui/components/worldmap/structures/StructureListItem.tsx
...
MyGuild.tsx
...
client/src/ui/components/worldmap/guilds/MyGuild.tsx
...
useBanks.tsx
...
client/src/hooks/helpers/useBanks.tsx
...
useCaravans.tsx
...
client/src/hooks/helpers/useCaravans.tsx
...
QuestPanel.tsx
...
client/src/ui/components/quest/QuestPanel.tsx
...
QuestList.tsx
...
client/src/ui/components/quest/QuestList.tsx
...
ResourceChip.tsx
...
client/src/ui/components/resources/ResourceChip.tsx
...
setupNetwork.ts
...
client/src/dojo/setupNetwork.ts
...
StructureConstructionMenu.tsx
...
client/src/ui/components/structures/construction/StructureConstructionMenu.tsx
...
StaminaResourceCost.tsx
...
client/src/ui/elements/StaminaResourceCost.tsx
...
hyperstructureEventQueries.ts
...
client/src/dojo/events/hyperstructureEventQueries.ts
...
TravelEntityPopup.tsx
...
client/src/ui/components/entities/TravelEntityPopup.tsx
...
EntitiesArmyTable.tsx
...
client/src/ui/components/military/EntitiesArmyTable.tsx
...
useTravelPath.tsx
...
client/src/ui/components/worldmap/hexagon/useTravelPath.tsx
...
ResourceWeight.tsx
...
client/src/ui/components/resources/ResourceWeight.tsx
...
Settings.tsx
...
client/src/ui/modules/settings/Settings.tsx
...
HyperstructureResourceChip.tsx
...
client/src/ui/components/hyperstructures/HyperstructureResourceChip.tsx
...
InventoryResources.tsx
...
client/src/ui/components/resources/InventoryResources.tsx
...
Military.tsx
...
client/src/ui/modules/military/Military.tsx
...
useUIStore.tsx
...
client/src/hooks/store/useUIStore.tsx
...
BattleListItem.tsx
...
client/src/ui/components/battles/BattleListItem.tsx
...
LockedResources.tsx
...
client/src/ui/modules/military/battle-view/LockedResources.tsx
...
Questing.tsx
...
client/src/ui/modules/questing/Questing.tsx
...
useBlockchainStore.tsx
...
client/src/hooks/store/useBlockchainStore.tsx
...
EntityList.tsx
...
client/src/ui/components/list/EntityList.tsx
...
ResourceArrivals.tsx
...
client/src/ui/components/trading/ResourceArrivals.tsx
...
pillageEventQueries.ts
...
client/src/dojo/events/pillageEventQueries.ts
...
QuestInfo.tsx
...
client/src/ui/components/quest/QuestInfo.tsx
...
PlayersLeaderboard.tsx
...
client/src/ui/components/worldmap/leaderboard/PlayersLeaderboard.tsx
...
LiquidityTable.tsx
...
client/src/ui/components/bank/LiquidityTable.tsx
...
HyperstructurePanel.tsx
...
client/src/ui/components/hyperstructures/HyperstructurePanel.tsx
...
BattleDetails.tsx
...
client/src/ui/modules/military/battle-view/BattleDetails.tsx
...
useBattles.test.tsx
...
client/src/hooks/helpers/battles/test/useBattles.test.tsx
...
index.ts
...
client/src/types/index.ts
...
EntityResourceTable.tsx
...
client/src/ui/components/resources/EntityResourceTable.tsx
...
ArmyFlag.tsx
...
client/src/ui/components/worldmap/armies/ArmyFlag.tsx
...
Whitelist.tsx
...
client/src/ui/components/worldmap/guilds/Whitelist.tsx
...
utils.tsx
...
client/src/ui/components/worldmap/guilds/utils.tsx
...
ArmyChip.tsx
...
client/src/ui/components/military/ArmyChip.tsx
...
dojoConfig.ts
...
client/dojoConfig.ts
...
types.ts
...
client/src/hooks/store/types.ts
...
index.ts
...
config/index.ts
...
structures.ts
...
sdk/packages/eternum/src/constants/structures.ts
...
contracts.sh
...
contracts/scripts/contracts.sh
...
set_writer.sh
...
contracts/scripts/set_writer.sh
...
pnpm-lock.yaml
...
pnpm-lock.yaml
...
manifest.toml
...
contracts/manifests/prod/deployment/manifest.toml
...
package.json
...
client/package.json
...
manifest.toml
...
contracts/manifests/dev/deployment/manifest.toml
...
manifest.json
...
contracts/manifests/dev/deployment/manifest.json
...
package.json
...
config/package.json
...
package.json
...
sdk/packages/eternum/package.json
...