@jeremyckahn/farmhand 1.19.19 → 1.19.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-BxA2fVaN.js → index-CG_lY1MJ.js} +9 -9
- package/dist/assets/{index-BxA2fVaN.js.map → index-CG_lY1MJ.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +3 -2
- package/src/common/services/{randomNumber.js → randomNumber.ts} +1 -0
- package/src/common/{utils.js → utils.ts} +1 -1
- package/src/components/AccountingView/{AccountingView.js → AccountingView.tsx} +1 -0
- package/src/components/AchievementsView/{AchievementsView.js → AchievementsView.tsx} +6 -4
- package/src/components/AnimatedNumber/{AnimatedNumber.js → AnimatedNumber.tsx} +9 -6
- package/src/components/AppBar/{AppBar.js → AppBar.tsx} +5 -2
- package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.js → BailOutErrorBoundary.tsx} +2 -0
- package/src/components/Cellar/{CellarInventoryTabPanel.js → CellarInventoryTabPanel.tsx} +2 -0
- package/src/components/Cellar/{Keg.js → Keg.tsx} +0 -1
- package/src/components/ContextPane/{ContextPane.test.js → ContextPane.test.tsx} +3 -0
- package/src/components/ContextPane/{ContextPane.js → ContextPane.tsx} +2 -0
- package/src/components/CowCard/Bloodline/{Bloodline.test.js → Bloodline.test.tsx} +6 -3
- package/src/components/CowCard/{CowCard.js → CowCard.tsx} +6 -4
- package/src/components/CowCard/Subheader/{Subheader.js → Subheader.tsx} +1 -0
- package/src/components/CowPen/{Cow.js → Cow.tsx} +27 -13
- package/src/components/CowPen/{CowPen.test.js → CowPen.test.tsx} +15 -1
- package/src/components/CowPen/{Tumbleweeds.js → Tumbleweeds.tsx} +2 -1
- package/src/components/Farmhand/{Farmhand.context.js → Farmhand.context.tsx} +2 -2
- package/src/components/Farmhand/{Farmhand.js → Farmhand.tsx} +91 -24
- package/src/components/FermentationRecipeList/{FermentationRecipe.js → FermentationRecipe.tsx} +4 -3
- package/src/components/FermentationRecipeList/{FermentationRecipeList.test.js → FermentationRecipeList.test.tsx} +5 -0
- package/src/components/FermentationRecipeList/{FermentationRecipeList.js → FermentationRecipeList.tsx} +3 -0
- package/src/components/Field/{Field.test.js → Field.test.tsx} +2 -3
- package/src/components/Field/{Field.js → Field.tsx} +23 -18
- package/src/components/Home/{Home.js → Home.tsx} +1 -0
- package/src/components/Home/{SnowBackground.js → SnowBackground.tsx} +2 -0
- package/src/components/Inventory/{Inventory.js → Inventory.tsx} +33 -25
- package/src/components/Item/{Item.js → Item.tsx} +2 -1
- package/src/components/LogView/{LogView.js → LogView.tsx} +23 -18
- package/src/components/Navigation/{Navigation.js → Navigation.tsx} +5 -6
- package/src/components/NotificationSystem/{NotificationSystem.js → NotificationSystem.tsx} +0 -1
- package/src/components/OnlinePeersView/{OnlinePeersView.js → OnlinePeersView.tsx} +7 -4
- package/src/components/Plot/{Plot.test.js → Plot.test.tsx} +8 -8
- package/src/components/Plot/{Plot.js → Plot.tsx} +5 -0
- package/src/components/PriceEventView/{PriceEventView.test.js → PriceEventView.test.tsx} +1 -0
- package/src/components/ProgressBar/{ProgressBar.js → ProgressBar.tsx} +2 -0
- package/src/components/QuantityInput/{QuantityInput.js → QuantityInput.tsx} +1 -0
- package/src/components/Recipe/{Recipe.js → Recipe.tsx} +1 -2
- package/src/components/SettingsView/{RandomSeedInput.js → RandomSeedInput.tsx} +1 -1
- package/src/components/Shop/{Shop.js → Shop.tsx} +2 -1
- package/src/components/Stage/{Stage.test.js → Stage.test.tsx} +1 -0
- package/src/components/Stage/{Stage.js → Stage.tsx} +6 -3
- package/src/components/TierPurchase/{TierPurchase.js → TierPurchase.tsx} +3 -3
- package/src/components/Toolbelt/{Toolbelt.js → Toolbelt.tsx} +3 -0
- package/src/components/UpgradePurchase/{UpgradePurchase.js → UpgradePurchase.tsx} +0 -1
- package/src/components/WineRecipeList/{WineRecipe.test.js → WineRecipe.test.tsx} +10 -1
- package/src/components/WineRecipeList/{WineRecipe.js → WineRecipe.tsx} +2 -1
- package/src/components/WineRecipeList/{WineRecipeList.js → WineRecipeList.tsx} +1 -0
- package/src/components/Workshop/{ForgeTabPanel.js → ForgeTabPanel.tsx} +1 -0
- package/src/components/Workshop/{Workshop.test.js → Workshop.test.tsx} +2 -2
- package/src/components/Workshop/{getUpgradesAvailable.test.js → getUpgradesAvailable.test.ts} +1 -0
- package/src/components/Workshop/{getUpgradesAvailable.js → getUpgradesAvailable.ts} +2 -0
- package/src/{constants.js → constants.ts} +2 -2
- package/src/data/{achievements.test.js → achievements.test.ts} +2 -1
- package/src/data/{achievements.js → achievements.ts} +9 -0
- package/src/data/{crop.js → crop.ts} +5 -4
- package/src/data/crops/{asparagus.js → asparagus.ts} +2 -0
- package/src/data/crops/{carrot.js → carrot.ts} +2 -0
- package/src/data/crops/{corn.js → corn.ts} +2 -0
- package/src/data/crops/{garlic.js → garlic.ts} +2 -0
- package/src/data/crops/{grape.js → grape.ts} +11 -7
- package/src/data/crops/{jalapeno.js → jalapeno.ts} +2 -0
- package/src/data/crops/{olive.js → olive.ts} +2 -0
- package/src/data/crops/{onion.js → onion.ts} +2 -0
- package/src/data/crops/{pea.js → pea.ts} +2 -0
- package/src/data/crops/{potato.js → potato.ts} +2 -0
- package/src/data/crops/{pumpkin.js → pumpkin.ts} +2 -0
- package/src/data/crops/{soybean.js → soybean.ts} +2 -0
- package/src/data/crops/{spinach.js → spinach.ts} +2 -0
- package/src/data/crops/{strawberry.js → strawberry.ts} +2 -0
- package/src/data/crops/{sunflower.js → sunflower.ts} +2 -0
- package/src/data/crops/{sweet-potato.js → sweet-potato.ts} +2 -0
- package/src/data/crops/{tomato.js → tomato.ts} +2 -0
- package/src/data/crops/{watermelon.js → watermelon.ts} +2 -0
- package/src/data/crops/{wheat.js → wheat.ts} +2 -0
- package/src/data/{items.js → items.ts} +12 -12
- package/src/data/{levels.js → levels.ts} +28 -0
- package/src/data/{maps.js → maps.ts} +2 -1
- package/src/data/ores/{bronzeOre.js → bronzeOre.ts} +1 -1
- package/src/data/ores/{coal.js → coal.ts} +1 -1
- package/src/data/ores/{goldOre.js → goldOre.ts} +1 -1
- package/src/data/ores/{ironOre.js → ironOre.ts} +1 -1
- package/src/data/ores/{saltRock.js → saltRock.ts} +1 -1
- package/src/data/ores/{silverOre.js → silverOre.ts} +1 -1
- package/src/data/ores/{stone.js → stone.ts} +1 -1
- package/src/data/{recipes.js → recipes.ts} +43 -43
- package/src/data/{upgrades.js → upgrades.ts} +4 -4
- package/src/{enums.js → enums.ts} +28 -28
- package/src/factories/{CoalFactory.js → CoalFactory.ts} +2 -0
- package/src/factories/{OreFactory.js → OreFactory.ts} +3 -0
- package/src/factories/{ResourceFactory.test.js → ResourceFactory.test.ts} +4 -0
- package/src/factories/{ResourceFactory.js → ResourceFactory.ts} +4 -0
- package/src/factories/{StoneFactory.js → StoneFactory.ts} +1 -0
- package/src/{fetch-utils.js → fetch-utils.ts} +2 -0
- package/src/game-logic/{field-purchase.test.js → field-purchase.test.ts} +4 -2
- package/src/game-logic/reducers/{applyCrows.js → applyCrows.ts} +3 -0
- package/src/game-logic/reducers/{applyLoanInterest.js → applyLoanInterest.ts} +1 -1
- package/src/game-logic/reducers/{applyPrecipitation.js → applyPrecipitation.ts} +6 -6
- package/src/game-logic/reducers/{changeCowAutomaticHugState.js → changeCowAutomaticHugState.ts} +2 -2
- package/src/game-logic/reducers/{computeStateForNextDay.js → computeStateForNextDay.ts} +2 -2
- package/src/game-logic/reducers/{consumeIngredients.js → consumeIngredients.ts} +2 -2
- package/src/game-logic/reducers/{harvestPlot.js → harvestPlot.ts} +4 -4
- package/src/game-logic/reducers/{makeFermentationRecipe.js → makeFermentationRecipe.ts} +1 -0
- package/src/game-logic/reducers/{makeRecipe.test.js → makeRecipe.test.ts} +11 -8
- package/src/game-logic/reducers/{makeWine.test.js → makeWine.test.ts} +0 -2
- package/src/game-logic/reducers/{makeWine.js → makeWine.ts} +1 -0
- package/src/game-logic/reducers/{minePlot.js → minePlot.ts} +1 -0
- package/src/game-logic/reducers/{processCellarSpoilage.test.js → processCellarSpoilage.test.ts} +0 -5
- package/src/game-logic/reducers/{processCellarSpoilage.js → processCellarSpoilage.ts} +0 -1
- package/src/game-logic/reducers/{processCowFertilizerProduction.js → processCowFertilizerProduction.ts} +1 -1
- package/src/game-logic/reducers/{processLevelUp.js → processLevelUp.ts} +3 -0
- package/src/game-logic/reducers/{purchaseField.test.js → purchaseField.test.ts} +2 -0
- package/src/game-logic/reducers/{purchaseField.js → purchaseField.ts} +3 -2
- package/src/game-logic/reducers/{purchaseForest.test.js → purchaseForest.test.tsx} +6 -2
- package/src/game-logic/reducers/{purchaseForest.js → purchaseForest.ts} +3 -2
- package/src/game-logic/reducers/{rotateNotificationLogs.js → rotateNotificationLogs.ts} +1 -1
- package/src/game-logic/reducers/{sellCow.test.js → sellCow.test.ts} +3 -3
- package/src/game-logic/reducers/{sellItem.test.js → sellItem.test.ts} +0 -3
- package/src/game-logic/reducers/{sellKeg.js → sellKeg.ts} +0 -1
- package/src/game-logic/reducers/{spawnWeeds.js → spawnWeeds.ts} +1 -0
- package/src/game-logic/reducers/{updateAchievements.js → updateAchievements.ts} +10 -9
- package/src/game-logic/reducers/{updatePeer.test.js → updatePeer.test.ts} +0 -4
- package/src/game-logic/reducers/{updatePeer.js → updatePeer.ts} +1 -0
- package/src/game-logic/reducers/{updatePlotShoveledState.test.js → updatePlotShoveledState.test.ts} +0 -1
- package/src/handlers/{peer-events.js → peer-events.ts} +9 -3
- package/src/handlers/{ui-events.test.js → ui-events.test.ts} +2 -0
- package/src/handlers/{ui-events.js → ui-events.tsx} +107 -25
- package/src/{index.js → index.tsx} +2 -0
- package/src/scripts/{generate-crop-table.js → generate-crop-table.ts} +5 -4
- package/src/services/{cellar.test.js → cellar.test.ts} +1 -1
- package/src/services/{wine.js → wine.ts} +1 -0
- package/src/shell/{notifications.test.js → notifications.test.ts} +19 -13
- package/src/{templates.js → templates.ts} +8 -0
- package/src/test-utils/{index.js → index.ts} +3 -3
- package/src/test-utils/stubs/{getKegStub.js → getKegStub.ts} +1 -0
- package/src/utils/{farmProductsSold.js → farmProductsSold.tsx} +2 -0
- package/src/utils/{getCropLifecycleDuration.js → getCropLifecycleDuration.ts} +1 -0
- package/src/utils/{getCropsAvailableToFerment.js → getCropsAvailableToFerment.ts} +1 -0
- package/src/utils/{getInventoryQuantityMap.js → getInventoryQuantityMap.ts} +1 -0
- package/src/utils/{getLevelEntitlements.js → getLevelEntitlements.ts} +4 -0
- package/src/utils/{getMaxYieldOfFermentationRecipe.js → getMaxYieldOfFermentationRecipe.ts} +1 -0
- package/src/utils/{getWineVarietiesAvailableToMake.js → getWineVarietiesAvailableToMake.ts} +2 -0
- package/src/utils/{index.test.js → index.test.ts} +0 -2
- package/src/utils/{index.js → index.tsx} +31 -18
- package/src/utils/{isItemAFarmProduct.js → isItemAFarmProduct.ts} +1 -1
- package/src/utils/{memoize.js → memoize.ts} +2 -0
- package/src/utils/{totalIngredientsInRecipe.js → totalIngredientsInRecipe.ts} +2 -0
- /package/src/common/{constants.js → constants.ts} +0 -0
- /package/src/common/services/{randomNumber.test.js → randomNumber.test.ts} +0 -0
- /package/src/common/{utils.test.js → utils.test.ts} +0 -0
- /package/src/components/AccountingView/{AccountingView.test.js → AccountingView.test.tsx} +0 -0
- /package/src/components/AccountingView/{index.js → index.ts} +0 -0
- /package/src/components/Achievement/{Achievement.test.js → Achievement.test.tsx} +0 -0
- /package/src/components/Achievement/{Achievement.js → Achievement.tsx} +0 -0
- /package/src/components/Achievement/{index.js → index.ts} +0 -0
- /package/src/components/AchievementsView/{AchievementsView.test.js → AchievementsView.test.tsx} +0 -0
- /package/src/components/AchievementsView/{index.js → index.ts} +0 -0
- /package/src/components/AnimatedNumber/{AnimatedNumber.test.js → AnimatedNumber.test.tsx} +0 -0
- /package/src/components/AnimatedNumber/{index.js → index.ts} +0 -0
- /package/src/components/AppBar/{AppBar.test.js → AppBar.test.tsx} +0 -0
- /package/src/components/AppBar/{index.js → index.ts} +0 -0
- /package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.test.js → BailOutErrorBoundary.test.tsx} +0 -0
- /package/src/components/BailOutErrorBoundary/{index.js → index.ts} +0 -0
- /package/src/components/Cellar/{Cellar.js → Cellar.tsx} +0 -0
- /package/src/components/Cellar/{FermentationTabPanel.js → FermentationTabPanel.tsx} +0 -0
- /package/src/components/Cellar/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Cellar/{WinemakingTabPanel.js → WinemakingTabPanel.tsx} +0 -0
- /package/src/components/Cellar/{index.js → index.ts} +0 -0
- /package/src/components/ChatRoom/{ChatRoom.js → ChatRoom.tsx} +0 -0
- /package/src/components/ChatRoom/{index.js → index.ts} +0 -0
- /package/src/components/ContextPane/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/Bloodline/{Bloodline.js → Bloodline.tsx} +0 -0
- /package/src/components/CowCard/Bloodline/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{CowCard.test.js → CowCard.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{Subheader.test.js → Subheader.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{index.js → index.ts} +0 -0
- /package/src/components/CowPen/{CowPen.js → CowPen.tsx} +0 -0
- /package/src/components/CowPen/{index.js → index.ts} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.test.js → CowPenContextMenu.test.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.js → CowPenContextMenu.tsx} +0 -0
- /package/src/components/CowPenContextMenu/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{index.js → index.ts} +0 -0
- /package/src/components/Elements/{index.js → index.ts} +0 -0
- /package/src/components/Farmhand/{Farmhand.test.js → Farmhand.test.ts} +0 -0
- /package/src/components/Farmhand/{FarmhandReducers.js → FarmhandReducers.tsx} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.test.js → getInventoryQuantities.test.ts} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.js → getInventoryQuantities.ts} +0 -0
- /package/src/components/Farmhand/{index.js → index.ts} +0 -0
- /package/src/components/Field/{index.js → index.ts} +0 -0
- /package/src/components/Forest/{Forest.js → Forest.tsx} +0 -0
- /package/src/components/Forest/{index.js → index.ts} +0 -0
- /package/src/components/Home/{Home.test.js → Home.test.tsx} +0 -0
- /package/src/components/Home/{index.js → index.ts} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.test.js → IngredientsList.test.tsx} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.js → IngredientsList.tsx} +0 -0
- /package/src/components/IngredientsList/{index.js → index.ts} +0 -0
- /package/src/components/Inventory/{Inventory.test.js → Inventory.test.tsx} +0 -0
- /package/src/components/Inventory/{index.js → index.ts} +0 -0
- /package/src/components/Item/{Item.test.js → Item.test.tsx} +0 -0
- /package/src/components/Item/{index.js → index.ts} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.test.js → KeybindingsView.test.tsx} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.js → KeybindingsView.tsx} +0 -0
- /package/src/components/KeybindingsView/{index.js → index.ts} +0 -0
- /package/src/components/LogView/{LogView.test.js → LogView.test.tsx} +0 -0
- /package/src/components/LogView/{index.js → index.ts} +0 -0
- /package/src/components/Navigation/{DayAndProgressContainer.js → DayAndProgressContainer.tsx} +0 -0
- /package/src/components/Navigation/{Navigation.test.js → Navigation.test.tsx} +0 -0
- /package/src/components/Navigation/{index.js → index.ts} +0 -0
- /package/src/components/NotificationSystem/{NotificationSystem.test.js → NotificationSystem.test.tsx} +0 -0
- /package/src/components/NotificationSystem/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.test.js → OnlinePeer.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.js → OnlinePeer.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/{OnlinePeersView.test.js → OnlinePeersView.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/{index.js → index.ts} +0 -0
- /package/src/components/Plot/{index.js → index.ts} +0 -0
- /package/src/components/PriceEventView/{PriceEventView.js → PriceEventView.tsx} +0 -0
- /package/src/components/PriceEventView/{index.js → index.ts} +0 -0
- /package/src/components/ProgressBar/{ProgressBar.test.js → ProgressBar.test.tsx} +0 -0
- /package/src/components/ProgressBar/{index.js → index.ts} +0 -0
- /package/src/components/QuantityInput/{QuantityInput.test.js → QuantityInput.test.tsx} +0 -0
- /package/src/components/QuantityInput/{index.js → index.ts} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.test.js → QuickSelect.test.tsx} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.js → QuickSelect.tsx} +0 -0
- /package/src/components/QuickSelect/{index.js → index.ts} +0 -0
- /package/src/components/Recipe/{Recipe.test.js → Recipe.test.tsx} +0 -0
- /package/src/components/Recipe/{index.js → index.ts} +0 -0
- /package/src/components/RecipeList/{RecipeList.js → RecipeList.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.test.js → SearchBar.test.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.js → SearchBar.tsx} +0 -0
- /package/src/components/SearchBar/{index.js → index.ts} +0 -0
- /package/src/components/SettingsView/{RandomSeedInput.test.js → RandomSeedInput.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.test.js → SettingsView.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.js → SettingsView.tsx} +0 -0
- /package/src/components/SettingsView/{index.js → index.ts} +0 -0
- /package/src/components/Shop/{Shop.test.js → Shop.test.tsx} +0 -0
- /package/src/components/Shop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Shop/{index.js → index.ts} +0 -0
- /package/src/components/Stage/{index.js → index.ts} +0 -0
- /package/src/components/StatsView/{StatsView.test.js → StatsView.test.tsx} +0 -0
- /package/src/components/StatsView/{StatsView.js → StatsView.tsx} +0 -0
- /package/src/components/StatsView/{index.js → index.ts} +0 -0
- /package/src/components/TierPurchase/{TierPurchase.test.js → TierPurchase.test.tsx} +0 -0
- /package/src/components/TierPurchase/{index.js → index.ts} +0 -0
- /package/src/components/Toolbelt/{Toolbelt.test.js → Toolbelt.test.tsx} +0 -0
- /package/src/components/Toolbelt/{index.js → index.ts} +0 -0
- /package/src/components/UpdateNotifier/{UpdateNotifier.js → UpdateNotifier.tsx} +0 -0
- /package/src/components/UpdateNotifier/{index.js → index.ts} +0 -0
- /package/src/components/UpgradePurchase/{UpgradePurchase.test.js → UpgradePurchase.test.tsx} +0 -0
- /package/src/components/UpgradePurchase/{index.js → index.ts} +0 -0
- /package/src/components/Workshop/{KitchenTabPanel.js → KitchenTabPanel.tsx} +0 -0
- /package/src/components/Workshop/{RecyclingTabPanel.js → RecyclingTabPanel.tsx} +0 -0
- /package/src/components/Workshop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Workshop/{Workshop.js → Workshop.tsx} +0 -0
- /package/src/components/Workshop/{index.js → index.ts} +0 -0
- /package/src/{config.js → config.ts} +0 -0
- /package/src/data/__mocks__/{items.js → items.ts} +0 -0
- /package/src/data/__mocks__/{maps.js → maps.ts} +0 -0
- /package/src/data/__mocks__/{recipes.js → recipes.ts} +0 -0
- /package/src/data/__mocks__/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/crops/{index.js → index.ts} +0 -0
- /package/src/data/{fruit-names.js → fruit-names.ts} +0 -0
- /package/src/data/{items-map.js → items-map.ts} +0 -0
- /package/src/data/ores/{index.js → index.ts} +0 -0
- /package/src/data/{shop-inventory-cow.js → shop-inventory-cow.ts} +0 -0
- /package/src/data/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/{tools.js → tools.ts} +0 -0
- /package/src/factories/{CoalFactory.test.js → CoalFactory.test.ts} +0 -0
- /package/src/factories/{OreFactory.test.js → OreFactory.test.ts} +0 -0
- /package/src/factories/{StoneFactory.test.js → StoneFactory.test.ts} +0 -0
- /package/src/factories/{index.js → index.ts} +0 -0
- /package/src/game-logic/cows/{cow-selection.test.js → cow-selection.test.ts} +0 -0
- /package/src/game-logic/{item-purchase.test.js → item-purchase.test.ts} +0 -0
- /package/src/game-logic/{item-sell.test.js → item-sell.test.ts} +0 -0
- /package/src/game-logic/reducers/{addCowToInventory.js → addCowToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.test.js → addExperience.test.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.js → addExperience.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.test.js → addItemToInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.js → addItemToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addKegToCellarInventory.js → addKegToCellarInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addPeer.js → addPeer.ts} +0 -0
- /package/src/game-logic/reducers/{addRevenue.js → addRevenue.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.test.js → adjustLoan.test.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.js → adjustLoan.ts} +0 -0
- /package/src/game-logic/reducers/{applyCrows.test.js → applyCrows.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyLoanInterest.test.js → applyLoanInterest.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyPrecipitation.test.js → applyPrecipitation.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowAutomaticHugState.test.js → changeCowAutomaticHugState.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.test.js → changeCowBreedingPenResident.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.js → changeCowBreedingPenResident.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.test.js → changeCowName.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.js → changeCowName.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.test.js → clearPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.js → clearPlot.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.test.js → computeCowInventoryForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.js → computeCowInventoryForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{computeStateForNextDay.test.js → computeStateForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{consumeIngredients.test.js → consumeIngredients.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.test.js → createPriceEvent.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.js → createPriceEvent.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.test.js → decrementItemFromInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.js → decrementItemFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.test.js → fertilizePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.js → fertilizePlot.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.test.js → forRange.test.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.js → forRange.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.test.js → generatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.js → generatePriceEvents.ts} +0 -0
- /package/src/game-logic/reducers/{harvestPlot.test.js → harvestPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{helpers.js → helpers.tsx} +0 -0
- /package/src/game-logic/reducers/{hugCow.test.js → hugCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{hugCow.js → hugCow.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.test.js → incrementPlotContentAge.test.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.js → incrementPlotContentAge.ts} +0 -0
- /package/src/game-logic/reducers/{index.js → index.ts} +0 -0
- /package/src/game-logic/reducers/{makeFermentationRecipe.test.js → makeFermentationRecipe.test.ts} +0 -0
- /package/src/game-logic/reducers/{makeRecipe.js → makeRecipe.ts} +0 -0
- /package/src/game-logic/reducers/{minePlot.test.js → minePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{modifyCow.js → modifyCow.ts} +0 -0
- /package/src/game-logic/reducers/{modifyFieldPlotAt.js → modifyFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.test.js → offerCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.js → offerCow.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.test.js → plantInPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.js → plantInPlot.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.test.js → prependPendingPeerMessage.test.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.js → prependPendingPeerMessage.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.test.js → processCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.js → processCellar.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.test.js → processCowAttrition.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.js → processCowAttrition.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.test.js → processCowBreeding.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.js → processCowBreeding.ts} +0 -0
- /package/src/game-logic/reducers/{processCowFertilizerProduction.test.js → processCowFertilizerProduction.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.test.js → processFeedingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.js → processFeedingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processField.js → processField.ts} +0 -0
- /package/src/game-logic/reducers/{processLevelUp.test.js → processLevelUp.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.test.js → processMilkingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.js → processMilkingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.test.js → processNerfs.test.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.js → processNerfs.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.test.js → processSprinklers.test.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.js → processSprinklers.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.test.js → processWeather.test.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.js → processWeather.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.test.js → purchaseCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.js → purchaseCellar.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.test.js → purchaseCombine.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.js → purchaseCombine.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.test.js → purchaseComposter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.js → purchaseComposter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.test.js → purchaseCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.js → purchaseCow.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.test.js → purchaseCowPen.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.js → purchaseCowPen.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.test.js → purchaseItem.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.js → purchaseItem.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.test.js → purchaseSmelter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.js → purchaseSmelter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.test.js → purchaseStorageExpansion.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.js → purchaseStorageExpansion.ts} +0 -0
- /package/src/game-logic/reducers/{removeCowFromInventory.js → removeCowFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{removeFieldPlotAt.js → removeFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{removeKegFromCellar.js → removeKegFromCellar.ts} +0 -0
- /package/src/game-logic/reducers/{removePeer.js → removePeer.ts} +0 -0
- /package/src/game-logic/reducers/{rotateNotificationLogs.test.js → rotateNotificationLogs.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.test.js → selectCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.js → selectCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellCow.js → sellCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellItem.js → sellItem.ts} +0 -0
- /package/src/game-logic/reducers/{sellKeg.test.js → sellKeg.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.test.js → setScarecrow.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.js → setScarecrow.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.test.js → setSprinkler.test.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.js → setSprinkler.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.test.js → showNotification.test.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.js → showNotification.ts} +0 -0
- /package/src/game-logic/reducers/{spawnWeeds.test.js → spawnWeeds.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.test.js → unlockTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.js → unlockTool.ts} +0 -0
- /package/src/game-logic/reducers/{updateAchievements.test.js → updateAchievements.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.test.js → updateFinancialRecords.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.js → updateFinancialRecords.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.test.js → updateInventoryRecordsForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.js → updateInventoryRecordsForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.test.js → updateLearnedRecipes.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.js → updateLearnedRecipes.ts} +0 -0
- /package/src/game-logic/reducers/{updatePlotShoveledState.js → updatePlotShoveledState.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.test.js → updatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.js → updatePriceEvents.tsx} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.test.js → upgradeTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.js → upgradeTool.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.test.js → waterAllPlots.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.js → waterAllPlots.ts} +0 -0
- /package/src/game-logic/reducers/{waterField.js → waterField.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.test.js → waterPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.js → waterPlot.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.test.js → withdrawCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.js → withdrawCow.ts} +0 -0
- /package/src/img/__mocks__/{index.js → index.ts} +0 -0
- /package/src/img/{index.js → index.ts} +0 -0
- /package/src/interfaces/{Factory.js → Factory.ts} +0 -0
- /package/src/{mui-theme.js → mui-theme.ts} +0 -0
- /package/src/{polyfills.js → polyfills.ts} +0 -0
- /package/src/services/{cellar.js → cellar.ts} +0 -0
- /package/src/services/{wine.test.js → wine.test.ts} +0 -0
- /package/src/{setupTests.js → setupTests.ts} +0 -0
- /package/src/shell/{bootup.test.js → bootup.test.ts} +0 -0
- /package/src/shell/{field.test.js → field.test.ts} +0 -0
- /package/src/shell/{game-saving.test.js → game-saving.test.ts} +0 -0
- /package/src/shell/{navigation.test.js → navigation.test.ts} +0 -0
- /package/src/shell/{pending-notifications.test.js → pending-notifications.test.ts} +0 -0
- /package/src/{strings.js → strings.ts} +0 -0
- /package/src/test-utils/stubs/{cowStub.js → cowStub.ts} +0 -0
- /package/src/test-utils/stubs/{farmhandStub.js → farmhandStub.tsx} +0 -0
- /package/src/test-utils/stubs/{itemStub.js → itemStub.ts} +0 -0
- /package/src/test-utils/stubs/{peerMetadataStub.js → peerMetadataStub.ts} +0 -0
- /package/src/test-utils/stubs/{saveDataStubFactory.js → saveDataStubFactory.ts} +0 -0
- /package/src/test-utils/{ui.js → ui.ts} +0 -0
- /package/src/utils/__snapshots__/{index.test.js.snap → index.test.ts.snap} +0 -0
- /package/src/utils/{findInField.test.js → findInField.test.ts} +0 -0
- /package/src/utils/{findInField.js → findInField.ts} +0 -0
- /package/src/utils/{getCropLifecycleDuration.test.js → getCropLifecycleDuration.test.ts} +0 -0
- /package/src/utils/{getCropsAvailableToFerment.test.js → getCropsAvailableToFerment.test.ts} +0 -0
- /package/src/utils/{getItemBaseValue.js → getItemBaseValue.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.test.js → getKegSpoilageRate.test.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.js → getKegSpoilageRate.ts} +0 -0
- /package/src/utils/{getKegValue.test.js → getKegValue.test.ts} +0 -0
- /package/src/utils/{getKegValue.js → getKegValue.ts} +0 -0
- /package/src/utils/{getLevelEntitlements.test.js → getLevelEntitlements.test.ts} +0 -0
- /package/src/utils/{getMaxYieldOfFermentationRecipe.test.js → getMaxYieldOfFermentationRecipe.test.ts} +0 -0
- /package/src/utils/{getSaltRequirementsForFermentationRecipe.js → getSaltRequirementsForFermentationRecipe.ts} +0 -0
- /package/src/utils/{getWineVarietiesAvailableToMake.test.js → getWineVarietiesAvailableToMake.test.ts} +0 -0
- /package/src/utils/{getYeastRequiredForWine.js → getYeastRequiredForWine.ts} +0 -0
- /package/src/utils/{isItemAGrownCrop.js → isItemAGrownCrop.ts} +0 -0
- /package/src/utils/{levelAchieved.js → levelAchieved.ts} +0 -0
- /package/src/utils/{moneyString.test.js → moneyString.test.ts} +0 -0
- /package/src/utils/{moneyString.js → moneyString.ts} +0 -0
- /package/src/utils/{noop.js → noop.ts} +0 -0
- /package/src/utils/{totalIngredientsInRecipe.test.js → totalIngredientsInRecipe.test.ts} +0 -0
|
@@ -116,6 +116,7 @@ const { CLEANUP, HARVEST, MINE, OBSERVE, WATER, PLANT } = fieldMode
|
|
|
116
116
|
// Utility object for reuse in no-ops to save on memory
|
|
117
117
|
const emptyObject = Object.freeze({})
|
|
118
118
|
|
|
119
|
+
// @ts-expect-error
|
|
119
120
|
export const computePlayerInventory = memoize(
|
|
120
121
|
/**
|
|
121
122
|
* @param {{ id: globalThis.farmhand.item['id'], quantity: number }[]} inventory
|
|
@@ -130,6 +131,7 @@ export const computePlayerInventory = memoize(
|
|
|
130
131
|
}))
|
|
131
132
|
)
|
|
132
133
|
|
|
134
|
+
// @ts-expect-error
|
|
133
135
|
export const getFieldToolInventory = memoize(
|
|
134
136
|
/**
|
|
135
137
|
* @param {globalThis.farmhand.state['inventory']} inventory
|
|
@@ -147,6 +149,7 @@ export const getFieldToolInventory = memoize(
|
|
|
147
149
|
.map(({ id, quantity }) => ({ ...itemsMap[id], quantity }))
|
|
148
150
|
)
|
|
149
151
|
|
|
152
|
+
// @ts-expect-error
|
|
150
153
|
export const getPlantableCropInventory = memoize(
|
|
151
154
|
/**
|
|
152
155
|
* @param {globalThis.farmhand.state['inventory']} inventory
|
|
@@ -254,6 +257,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
254
257
|
viewList.unshift(HOME)
|
|
255
258
|
}
|
|
256
259
|
|
|
260
|
+
// @ts-expect-error
|
|
257
261
|
if (this.isForestUnlocked && features.FOREST) {
|
|
258
262
|
viewList.push(FOREST)
|
|
259
263
|
}
|
|
@@ -304,12 +308,12 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
304
308
|
* @returns {farmhand.state}
|
|
305
309
|
*/
|
|
306
310
|
createInitialState() {
|
|
307
|
-
return /** @type {farmhand.state} */
|
|
311
|
+
return /** @type {farmhand.state} */ {
|
|
308
312
|
activePlayers: null,
|
|
309
313
|
allowCustomPeerCowNames: false,
|
|
310
314
|
cellarInventory: [],
|
|
311
315
|
currentDialogView:
|
|
312
|
-
/** @type {globalThis.farmhand.dialogView} */
|
|
316
|
+
/** @type {globalThis.farmhand.dialogView} */ dialogView.NONE,
|
|
313
317
|
completedAchievements: {},
|
|
314
318
|
cowForSale: generateCow(),
|
|
315
319
|
cowBreedingPen: {
|
|
@@ -328,7 +332,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
328
332
|
experience: 0,
|
|
329
333
|
farmName: 'Unnamed',
|
|
330
334
|
field: createNewField(),
|
|
331
|
-
fieldMode: /** @type {globalThis.farmhand.fieldMode} */
|
|
335
|
+
fieldMode: /** @type {globalThis.farmhand.fieldMode} */ OBSERVE,
|
|
332
336
|
forest: createNewForest(),
|
|
333
337
|
getCowAccept: noop,
|
|
334
338
|
getCowReject: noop,
|
|
@@ -351,6 +355,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
351
355
|
cellarItemsSold: {},
|
|
352
356
|
isChatOpen: false,
|
|
353
357
|
isDialogViewOpen: false,
|
|
358
|
+
// @ts-expect-error
|
|
354
359
|
isOnline: this.props.match.path.startsWith('/online'),
|
|
355
360
|
isWaitingForDayToCompleteIncrementing: false,
|
|
356
361
|
learnedRecipes: {},
|
|
@@ -375,6 +380,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
375
380
|
recordSingleDayProfit: 0,
|
|
376
381
|
revenue: 0,
|
|
377
382
|
redirect: '',
|
|
383
|
+
// @ts-expect-error
|
|
378
384
|
room: decodeURIComponent(this.props.match.params.room || DEFAULT_ROOM),
|
|
379
385
|
sendCowAccept: noop,
|
|
380
386
|
sendCowReject: noop,
|
|
@@ -389,22 +395,22 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
389
395
|
showHomeScreen: true,
|
|
390
396
|
showNotifications: true,
|
|
391
397
|
stageFocus:
|
|
392
|
-
/** @type {globalThis.farmhand.stageFocusType} */
|
|
398
|
+
/** @type {globalThis.farmhand.stageFocusType} */ stageFocusType.HOME,
|
|
393
399
|
todaysNotifications: [],
|
|
394
400
|
todaysLosses: 0,
|
|
395
401
|
todaysPurchases: {},
|
|
396
402
|
todaysRevenue: 0,
|
|
397
403
|
todaysStartingInventory: {},
|
|
398
|
-
toolLevels: /** @type {Record<import('../../enums.js').toolType, import('../../enums.js').toolLevel>} */
|
|
404
|
+
toolLevels: /** @type {Record<import('../../enums.js').toolType, import('../../enums.js').toolLevel>} */ {
|
|
399
405
|
[toolType.HOE]: toolLevel.DEFAULT,
|
|
400
406
|
[toolType.SCYTHE]: toolLevel.DEFAULT,
|
|
401
407
|
[toolType.SHOVEL]: toolLevel.UNAVAILABLE,
|
|
402
408
|
[toolType.WATERING_CAN]: toolLevel.DEFAULT,
|
|
403
|
-
}
|
|
409
|
+
},
|
|
404
410
|
useAlternateEndDayButtonPosition: false,
|
|
405
411
|
valueAdjustments: {},
|
|
406
412
|
version: import.meta.env?.VITE_FARMHAND_PACKAGE_VERSION ?? '',
|
|
407
|
-
}
|
|
413
|
+
}
|
|
408
414
|
}
|
|
409
415
|
|
|
410
416
|
async initializeNewGame() {
|
|
@@ -414,6 +420,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
414
420
|
historicalValueAdjustments: [],
|
|
415
421
|
}))
|
|
416
422
|
|
|
423
|
+
// @ts-expect-error
|
|
417
424
|
this.showNotification(LOAN_INCREASED('', STANDARD_LOAN_AMOUNT), 'info')
|
|
418
425
|
}
|
|
419
426
|
|
|
@@ -459,20 +466,20 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
459
466
|
previousView: this.focusPreviousView.bind(this),
|
|
460
467
|
selectHoe: () =>
|
|
461
468
|
this.handlers.handleFieldModeSelect(
|
|
462
|
-
/** @type {globalThis.farmhand.fieldMode} */
|
|
469
|
+
/** @type {globalThis.farmhand.fieldMode} */ CLEANUP
|
|
463
470
|
),
|
|
464
471
|
selectScythe: () =>
|
|
465
472
|
this.handlers.handleFieldModeSelect(
|
|
466
|
-
/** @type {globalThis.farmhand.fieldMode} */
|
|
473
|
+
/** @type {globalThis.farmhand.fieldMode} */ HARVEST
|
|
467
474
|
),
|
|
468
475
|
selectWateringCan: () =>
|
|
469
476
|
this.handlers.handleFieldModeSelect(
|
|
470
|
-
/** @type {globalThis.farmhand.fieldMode} */
|
|
477
|
+
/** @type {globalThis.farmhand.fieldMode} */ WATER
|
|
471
478
|
),
|
|
472
479
|
selectShovel: () => {
|
|
473
480
|
if (this.state.toolLevels[toolType.SHOVEL] !== toolLevel.UNAVAILABLE) {
|
|
474
481
|
this.handlers.handleFieldModeSelect(
|
|
475
|
-
/** @type {globalThis.farmhand.fieldMode} */
|
|
482
|
+
/** @type {globalThis.farmhand.fieldMode} */ MINE
|
|
476
483
|
)
|
|
477
484
|
}
|
|
478
485
|
},
|
|
@@ -506,13 +513,14 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
506
513
|
}
|
|
507
514
|
|
|
508
515
|
async componentDidMount() {
|
|
516
|
+
// @ts-expect-error
|
|
509
517
|
const state = await this.props.localforage.getItem('state')
|
|
510
518
|
|
|
511
519
|
if (state) {
|
|
512
520
|
const sanitizedState = transformStateDataForImport({
|
|
513
521
|
...this.createInitialState(),
|
|
514
522
|
// eslint-disable-next-line
|
|
515
|
-
.../** @type {Partial<farmhand.state>} */
|
|
523
|
+
.../** @type {Partial<farmhand.state>} */ state,
|
|
516
524
|
})
|
|
517
525
|
const { isCombineEnabled, newDayNotifications } = sanitizedState
|
|
518
526
|
|
|
@@ -520,9 +528,11 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
520
528
|
newDayNotifications.forEach(({ message, severity }) => {
|
|
521
529
|
// Defer these notifications so that notistack doesn't swallow all
|
|
522
530
|
// but the last one.
|
|
531
|
+
// @ts-expect-error
|
|
523
532
|
setTimeout(() => this.showNotification(message, severity), 0)
|
|
524
533
|
|
|
525
534
|
if (isCombineEnabled) {
|
|
535
|
+
// @ts-expect-error
|
|
526
536
|
this.forRange(reducers.harvestPlot, Infinity, 0, 0)
|
|
527
537
|
}
|
|
528
538
|
})
|
|
@@ -557,6 +567,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
557
567
|
}
|
|
558
568
|
|
|
559
569
|
const {
|
|
570
|
+
// @ts-expect-error
|
|
560
571
|
match: {
|
|
561
572
|
path,
|
|
562
573
|
params: { room: newRoom = room },
|
|
@@ -592,6 +603,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
592
603
|
}
|
|
593
604
|
|
|
594
605
|
if (isOnline === false && prevState.isOnline === true) {
|
|
606
|
+
// @ts-expect-error
|
|
595
607
|
this.showNotification(DISCONNECTED_FROM_SERVER, 'info')
|
|
596
608
|
}
|
|
597
609
|
|
|
@@ -618,6 +630,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
618
630
|
}
|
|
619
631
|
|
|
620
632
|
if (money < prevState.money) {
|
|
633
|
+
// @ts-expect-error
|
|
621
634
|
this.setState(({ todaysLosses }) => ({
|
|
622
635
|
todaysLosses: moneyTotal(todaysLosses, money - prevState.money),
|
|
623
636
|
}))
|
|
@@ -625,23 +638,32 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
625
638
|
|
|
626
639
|
if (peerRoom !== prevState.peerRoom) {
|
|
627
640
|
if (peerRoom) {
|
|
641
|
+
// @ts-expect-error
|
|
628
642
|
peerRoom.onPeerJoin(id => {
|
|
643
|
+
// @ts-expect-error
|
|
629
644
|
this.addPeer(id)
|
|
630
645
|
})
|
|
631
646
|
|
|
647
|
+
// @ts-expect-error
|
|
632
648
|
peerRoom.onPeerLeave(id => {
|
|
649
|
+
// @ts-expect-error
|
|
633
650
|
this.removePeer(id)
|
|
634
651
|
})
|
|
635
652
|
|
|
636
|
-
|
|
653
|
+
// @ts-expect-error
|
|
654
|
+
const [sendPeerMetadata, getPeerMetadataFunc] = peerRoom.makeAction(
|
|
637
655
|
'peerMetadata'
|
|
638
656
|
)
|
|
639
657
|
|
|
640
|
-
|
|
658
|
+
getPeerMetadataFunc((
|
|
641
659
|
/** @type {[object, string]} */
|
|
642
660
|
...args
|
|
643
|
-
) =>
|
|
661
|
+
) =>
|
|
662
|
+
// @ts-expect-error
|
|
663
|
+
handlePeerMetadataRequest(this, ...args)
|
|
664
|
+
)
|
|
644
665
|
|
|
666
|
+
// @ts-expect-error
|
|
645
667
|
const [sendCowTradeRequest, getCowTradeRequest] = peerRoom.makeAction(
|
|
646
668
|
'cowTrade'
|
|
647
669
|
)
|
|
@@ -649,27 +671,38 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
649
671
|
getCowTradeRequest((
|
|
650
672
|
/** @type {[object, string]} */
|
|
651
673
|
...args
|
|
652
|
-
) =>
|
|
674
|
+
) =>
|
|
675
|
+
// @ts-expect-error
|
|
676
|
+
handleCowTradeRequest(this, ...args)
|
|
677
|
+
)
|
|
653
678
|
|
|
679
|
+
// @ts-expect-error
|
|
654
680
|
const [sendCowAccept, getCowAccept] = peerRoom.makeAction('cowAccept')
|
|
655
681
|
|
|
656
682
|
getCowAccept((
|
|
657
683
|
/** @type {[object, string]} */
|
|
658
684
|
...args
|
|
659
|
-
) =>
|
|
685
|
+
) =>
|
|
686
|
+
// @ts-expect-error
|
|
687
|
+
handleCowTradeRequestAccept(this, ...args)
|
|
688
|
+
)
|
|
660
689
|
|
|
690
|
+
// @ts-expect-error
|
|
661
691
|
const [sendCowReject, getCowReject] = peerRoom.makeAction('cowReject')
|
|
662
692
|
|
|
663
693
|
getCowReject((
|
|
664
694
|
/** @type {[object]} */
|
|
665
695
|
...args
|
|
666
|
-
) =>
|
|
696
|
+
) =>
|
|
697
|
+
// @ts-expect-error
|
|
698
|
+
handleCowTradeRequestReject(this, ...args)
|
|
699
|
+
)
|
|
667
700
|
|
|
668
701
|
this.setState({
|
|
669
702
|
getCowAccept,
|
|
670
703
|
getCowReject,
|
|
671
704
|
getCowTradeRequest,
|
|
672
|
-
getPeerMetadata,
|
|
705
|
+
getPeerMetadata: getPeerMetadataFunc,
|
|
673
706
|
pendingPeerMessages: [],
|
|
674
707
|
sendCowAccept,
|
|
675
708
|
sendCowReject,
|
|
@@ -690,6 +723,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
690
723
|
'showRecipeLearnedNotifications',
|
|
691
724
|
].forEach(fn => this[fn](prevState))
|
|
692
725
|
|
|
726
|
+
// @ts-expect-error
|
|
693
727
|
this.state.sendPeerMetadata?.(this.peerMetadata)
|
|
694
728
|
}
|
|
695
729
|
|
|
@@ -720,9 +754,13 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
720
754
|
tradeForPeerCow(peerPlayerCow) {
|
|
721
755
|
this.setState(state => {
|
|
722
756
|
const {
|
|
757
|
+
// @ts-expect-error
|
|
723
758
|
cowIdOfferedForTrade,
|
|
759
|
+
// @ts-expect-error
|
|
724
760
|
cowInventory,
|
|
761
|
+
// @ts-expect-error
|
|
725
762
|
peers,
|
|
763
|
+
// @ts-expect-error
|
|
726
764
|
sendCowTradeRequest,
|
|
727
765
|
} = state
|
|
728
766
|
|
|
@@ -731,6 +769,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
731
769
|
const { ownerId } = peerPlayerCow
|
|
732
770
|
|
|
733
771
|
const [peerId] =
|
|
772
|
+
// @ts-expect-error
|
|
734
773
|
Object.entries(peers).find(([, peer]) => peer?.playerId === ownerId) ??
|
|
735
774
|
[]
|
|
736
775
|
|
|
@@ -778,6 +817,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
778
817
|
|
|
779
818
|
handleCowTradeTimeout = () => {
|
|
780
819
|
if (typeof this.state.cowTradeTimeoutId === 'number') {
|
|
820
|
+
// @ts-expect-error
|
|
781
821
|
this.showNotification(REQUESTED_COW_TRADE_UNAVAILABLE, 'error')
|
|
782
822
|
this.setState({
|
|
783
823
|
cowTradeTimeoutId: null,
|
|
@@ -789,8 +829,10 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
789
829
|
}
|
|
790
830
|
|
|
791
831
|
async clearPersistedData() {
|
|
832
|
+
// @ts-expect-error
|
|
792
833
|
await this.props.localforage.clear()
|
|
793
834
|
|
|
835
|
+
// @ts-expect-error
|
|
794
836
|
this.showNotification(DATA_DELETED)
|
|
795
837
|
}
|
|
796
838
|
|
|
@@ -801,6 +843,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
801
843
|
return
|
|
802
844
|
}
|
|
803
845
|
|
|
846
|
+
// @ts-expect-error
|
|
804
847
|
this.showNotification(CONNECTING_TO_SERVER, 'info')
|
|
805
848
|
|
|
806
849
|
try {
|
|
@@ -809,6 +852,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
809
852
|
peers: {},
|
|
810
853
|
})
|
|
811
854
|
|
|
855
|
+
// @ts-expect-error
|
|
812
856
|
this.state.peerRoom?.leave()
|
|
813
857
|
|
|
814
858
|
const { valueAdjustments } = await getData(endpoints.getMarketData, {
|
|
@@ -838,12 +882,14 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
838
882
|
),
|
|
839
883
|
})
|
|
840
884
|
|
|
885
|
+
// @ts-expect-error
|
|
841
886
|
this.showNotification(CONNECTED_TO_ROOM('', room), 'success')
|
|
842
887
|
} catch (e) {
|
|
843
888
|
// TODO: Add some reasonable fallback behavior in case the server request
|
|
844
889
|
// fails. Possibility: Regenerate valueAdjustments and notify the user
|
|
845
890
|
// they are offline.
|
|
846
891
|
|
|
892
|
+
// @ts-expect-error
|
|
847
893
|
this.showNotification(SERVER_ERROR, 'error')
|
|
848
894
|
|
|
849
895
|
console.error(e)
|
|
@@ -869,6 +915,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
869
915
|
|
|
870
916
|
this.setState(() => ({
|
|
871
917
|
heartbeatTimeoutId: setTimeout(async () => {
|
|
918
|
+
// @ts-expect-error
|
|
872
919
|
this.setState(({ money, activePlayers }) => ({
|
|
873
920
|
activePlayers,
|
|
874
921
|
money: moneyTotal(money, activePlayers),
|
|
@@ -887,6 +934,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
887
934
|
inventorySpaceRemaining(prevState) > 0 &&
|
|
888
935
|
inventorySpaceRemaining(this.state) <= 0
|
|
889
936
|
) {
|
|
937
|
+
// @ts-expect-error
|
|
890
938
|
this.showNotification(INVENTORY_FULL_NOTIFICATION, 'warning')
|
|
891
939
|
}
|
|
892
940
|
}
|
|
@@ -899,13 +947,16 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
899
947
|
|
|
900
948
|
Object.keys(this.state.learnedRecipes).forEach(recipeId => {
|
|
901
949
|
if (!previousLearnedRecipes.hasOwnProperty(recipeId)) {
|
|
950
|
+
// @ts-expect-error
|
|
902
951
|
learnedRecipes.push(recipesMap[recipeId])
|
|
903
952
|
}
|
|
904
953
|
})
|
|
905
954
|
|
|
906
955
|
if (learnedRecipes.length > 1) {
|
|
956
|
+
// @ts-expect-error
|
|
907
957
|
this.showNotification(RECIPES_LEARNED('', learnedRecipes))
|
|
908
958
|
} else if (learnedRecipes.length === 1) {
|
|
959
|
+
// @ts-expect-error
|
|
909
960
|
this.showNotification(RECIPE_LEARNED('', learnedRecipes[0]))
|
|
910
961
|
}
|
|
911
962
|
}
|
|
@@ -915,6 +966,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
915
966
|
* @return {Promise}
|
|
916
967
|
*/
|
|
917
968
|
persistState(overrides = {}) {
|
|
969
|
+
// @ts-expect-error
|
|
918
970
|
return this.props.localforage.setItem(
|
|
919
971
|
'state',
|
|
920
972
|
reduceByPersistedKeys({
|
|
@@ -963,11 +1015,13 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
963
1015
|
).valueAdjustments
|
|
964
1016
|
|
|
965
1017
|
if (Object.keys(positions).length) {
|
|
1018
|
+
// @ts-expect-error
|
|
966
1019
|
serverMessages.push({
|
|
967
1020
|
message: POSITIONS_POSTED_NOTIFICATION('', 'You', positions),
|
|
968
1021
|
severity: 'info',
|
|
969
1022
|
})
|
|
970
1023
|
|
|
1024
|
+
// @ts-expect-error
|
|
971
1025
|
broadcastedPositionMessage = POSITIONS_POSTED_NOTIFICATION(
|
|
972
1026
|
'',
|
|
973
1027
|
'',
|
|
@@ -976,6 +1030,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
976
1030
|
}
|
|
977
1031
|
} catch (e) {
|
|
978
1032
|
// NOTE: This will get reached when there's an issue posting data to the server.
|
|
1033
|
+
// @ts-expect-error
|
|
979
1034
|
serverMessages.push({
|
|
980
1035
|
message: SERVER_ERROR,
|
|
981
1036
|
severity: 'error',
|
|
@@ -1020,6 +1075,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1020
1075
|
prev => {
|
|
1021
1076
|
const nextDayState = reducers.computeStateForNextDay(prev, isFirstDay)
|
|
1022
1077
|
|
|
1078
|
+
// @ts-expect-error
|
|
1023
1079
|
pendingNotifications = [
|
|
1024
1080
|
...serverMessages,
|
|
1025
1081
|
...nextDayState.newDayNotifications,
|
|
@@ -1052,11 +1108,13 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1052
1108
|
|
|
1053
1109
|
notifications
|
|
1054
1110
|
.concat(
|
|
1111
|
+
// @ts-expect-error
|
|
1055
1112
|
isFirstDay
|
|
1056
1113
|
? []
|
|
1057
1114
|
: [{ message: PROGRESS_SAVED_MESSAGE, severity: 'info' }]
|
|
1058
1115
|
)
|
|
1059
1116
|
.forEach(({ message, severity }) =>
|
|
1117
|
+
// @ts-expect-error
|
|
1060
1118
|
this.showNotification(message, severity)
|
|
1061
1119
|
)
|
|
1062
1120
|
|
|
@@ -1066,11 +1124,13 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1066
1124
|
await sleep(1000)
|
|
1067
1125
|
}
|
|
1068
1126
|
|
|
1127
|
+
// @ts-expect-error
|
|
1069
1128
|
this.forRange(reducers.harvestPlot, Infinity, 0, 0)
|
|
1070
1129
|
}
|
|
1071
1130
|
} catch (e) {
|
|
1072
1131
|
console.error(e)
|
|
1073
1132
|
|
|
1133
|
+
// @ts-expect-error
|
|
1074
1134
|
this.showNotification(JSON.stringify(e), 'error')
|
|
1075
1135
|
} finally {
|
|
1076
1136
|
this.setState(() => ({
|
|
@@ -1078,6 +1138,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1078
1138
|
}))
|
|
1079
1139
|
|
|
1080
1140
|
if (broadcastedPositionMessage) {
|
|
1141
|
+
// @ts-expect-error
|
|
1081
1142
|
this.messagePeers(broadcastedPositionMessage)
|
|
1082
1143
|
}
|
|
1083
1144
|
}
|
|
@@ -1086,10 +1147,10 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1086
1147
|
}
|
|
1087
1148
|
|
|
1088
1149
|
/*!
|
|
1089
|
-
* @param {farmhand.module:enums.dialogView}
|
|
1150
|
+
* @param {farmhand.module:enums.dialogView} dialogViewName
|
|
1090
1151
|
*/
|
|
1091
|
-
openDialogView(
|
|
1092
|
-
this.setState({ currentDialogView:
|
|
1152
|
+
openDialogView(dialogViewName) {
|
|
1153
|
+
this.setState({ currentDialogView: dialogViewName, isDialogViewOpen: true })
|
|
1093
1154
|
}
|
|
1094
1155
|
|
|
1095
1156
|
closeDialogView() {
|
|
@@ -1101,6 +1162,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1101
1162
|
|
|
1102
1163
|
const { viewList } = this
|
|
1103
1164
|
|
|
1165
|
+
// @ts-expect-error
|
|
1104
1166
|
this.setState(({ stageFocus }) => {
|
|
1105
1167
|
const currentViewIndex = viewList.indexOf(stageFocus)
|
|
1106
1168
|
|
|
@@ -1113,6 +1175,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1113
1175
|
|
|
1114
1176
|
const { viewList } = this
|
|
1115
1177
|
|
|
1178
|
+
// @ts-expect-error
|
|
1116
1179
|
this.setState(({ stageFocus }) => {
|
|
1117
1180
|
const currentViewIndex = viewList.indexOf(stageFocus)
|
|
1118
1181
|
|
|
@@ -1132,12 +1195,14 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1132
1195
|
* @param {string?} [severity]
|
|
1133
1196
|
*/
|
|
1134
1197
|
messagePeers(message, severity) {
|
|
1198
|
+
// @ts-expect-error
|
|
1135
1199
|
this.prependPendingPeerMessage(message, severity)
|
|
1136
1200
|
}
|
|
1137
1201
|
|
|
1138
1202
|
render() {
|
|
1139
1203
|
const {
|
|
1140
|
-
|
|
1204
|
+
// @ts-expect-error
|
|
1205
|
+
props: { features: propsFeatures },
|
|
1141
1206
|
state: { redirect },
|
|
1142
1207
|
fieldToolInventory,
|
|
1143
1208
|
handlers,
|
|
@@ -1159,7 +1224,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1159
1224
|
const gameState = {
|
|
1160
1225
|
...this.state,
|
|
1161
1226
|
blockInput,
|
|
1162
|
-
features,
|
|
1227
|
+
features: propsFeatures,
|
|
1163
1228
|
fieldToolInventory,
|
|
1164
1229
|
isChatAvailable,
|
|
1165
1230
|
levelEntitlements,
|
|
@@ -1194,6 +1259,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1194
1259
|
{redirect && <Redirect {...{ to: redirect }} />}
|
|
1195
1260
|
<FarmhandContext.Provider
|
|
1196
1261
|
value={{
|
|
1262
|
+
// @ts-expect-error
|
|
1197
1263
|
gameState,
|
|
1198
1264
|
handlers,
|
|
1199
1265
|
}}
|
|
@@ -1319,6 +1385,7 @@ export default class Farmhand extends FarmhandReducers {
|
|
|
1319
1385
|
}
|
|
1320
1386
|
}
|
|
1321
1387
|
|
|
1388
|
+
// @ts-expect-error
|
|
1322
1389
|
Farmhand.propTypes = {
|
|
1323
1390
|
features: object,
|
|
1324
1391
|
history: object,
|
package/src/components/FermentationRecipeList/{FermentationRecipe.js → FermentationRecipe.tsx}
RENAMED
|
@@ -38,7 +38,6 @@ export const FermentationRecipe = ({ item }) => {
|
|
|
38
38
|
const [quantity, setQuantity] = useState(1)
|
|
39
39
|
|
|
40
40
|
const inventoryQuantityMap = getInventoryQuantityMap(inventory)
|
|
41
|
-
// @ts-expect-error
|
|
42
41
|
const fermentationRecipeName = FERMENTED_CROP_NAME`${item}`
|
|
43
42
|
const { space: cellarSize } = PURCHASEABLE_CELLARS.get(purchasedCellar) ?? {
|
|
44
43
|
space: 0,
|
|
@@ -100,10 +99,12 @@ export const FermentationRecipe = ({ item }) => {
|
|
|
100
99
|
{integerString(inventoryQuantityMap[item.id] ?? 0)}
|
|
101
100
|
</p>
|
|
102
101
|
<p>
|
|
103
|
-
Units of {itemsMap.salt.name} required:{' '}
|
|
104
|
-
{getSaltRequirementsForFermentationRecipe(item)}
|
|
102
|
+
Units of {(itemsMap as any).salt.name} required:{' '}
|
|
103
|
+
{getSaltRequirementsForFermentationRecipe(item as any)}{' '}
|
|
104
|
+
(available:{' '}
|
|
105
105
|
<AnimatedNumber
|
|
106
106
|
{...{
|
|
107
|
+
// @ts-expect-error
|
|
107
108
|
number: inventoryQuantityMap[itemsMap.salt.id] ?? 0,
|
|
108
109
|
formatter: integerString,
|
|
109
110
|
}}
|
|
@@ -82,14 +82,17 @@ describe('FermentationRecipeList', () => {
|
|
|
82
82
|
await userEvent.type(searchBar, 'apple')
|
|
83
83
|
|
|
84
84
|
const filteredCrops = cropsAvailableToFerment.filter(item => {
|
|
85
|
+
// @ts-expect-error
|
|
85
86
|
const fermentationRecipeName = `Fermented ${item.name}`.toLowerCase()
|
|
86
87
|
return (
|
|
87
88
|
fermentationRecipeName.includes('apple') ||
|
|
89
|
+
// @ts-expect-error
|
|
88
90
|
item.name.toLowerCase().includes('apple')
|
|
89
91
|
)
|
|
90
92
|
})
|
|
91
93
|
|
|
92
94
|
filteredCrops.forEach(crop => {
|
|
95
|
+
// @ts-expect-error
|
|
93
96
|
expect(screen.getByText(crop.name)).toBeInTheDocument()
|
|
94
97
|
})
|
|
95
98
|
|
|
@@ -98,6 +101,7 @@ describe('FermentationRecipeList', () => {
|
|
|
98
101
|
)
|
|
99
102
|
|
|
100
103
|
nonMatchingCrops.forEach(crop => {
|
|
104
|
+
// @ts-expect-error
|
|
101
105
|
const nonMatchingElements = screen.queryAllByText(crop.name)
|
|
102
106
|
expect(nonMatchingElements).toHaveLength(1)
|
|
103
107
|
})
|
|
@@ -119,6 +123,7 @@ describe('FermentationRecipeList', () => {
|
|
|
119
123
|
await userEvent.clear(searchBar)
|
|
120
124
|
|
|
121
125
|
cropsAvailableToFerment.forEach(crop => {
|
|
126
|
+
// @ts-expect-error
|
|
122
127
|
expect(screen.getByText(crop.name)).toBeInTheDocument()
|
|
123
128
|
})
|
|
124
129
|
})
|
|
@@ -27,10 +27,12 @@ export const FermentationRecipeList = () => {
|
|
|
27
27
|
.filter(term => term.length > 0)
|
|
28
28
|
|
|
29
29
|
const filteredCrops = cropsAvailableToFerment.filter(item => {
|
|
30
|
+
// @ts-expect-error
|
|
30
31
|
const fermentationRecipeName = `${FERMENTED_CROP_NAME}${item.name}`.toLowerCase()
|
|
31
32
|
return searchTerms.every(
|
|
32
33
|
term =>
|
|
33
34
|
fermentationRecipeName.includes(term) ||
|
|
35
|
+
// @ts-expect-error
|
|
34
36
|
item.name.toLowerCase().includes(term)
|
|
35
37
|
)
|
|
36
38
|
})
|
|
@@ -52,6 +54,7 @@ export const FermentationRecipeList = () => {
|
|
|
52
54
|
{filteredCrops.length > 0 && (
|
|
53
55
|
<ul className="card-list">
|
|
54
56
|
{filteredCrops.map(item => (
|
|
57
|
+
// @ts-expect-error
|
|
55
58
|
<li key={item.id}>
|
|
56
59
|
<FermentationRecipe item={item} />
|
|
57
60
|
</li>
|
|
@@ -10,12 +10,12 @@ import { Field, FieldContent, isInHoverRange, MemoPlot } from './Field.js'
|
|
|
10
10
|
|
|
11
11
|
// Mock Plot component to test MemoPlot memoization behavior
|
|
12
12
|
vitest.mock('../Plot/index.js', () => {
|
|
13
|
-
const mockPlot = vitest.fn(({ x, y, isInHoverRange }) => (
|
|
13
|
+
const mockPlot = vitest.fn(({ x, y, isInHoverRange: isInRange }) => (
|
|
14
14
|
<div
|
|
15
15
|
className="Plot"
|
|
16
16
|
data-x={x}
|
|
17
17
|
data-y={y}
|
|
18
|
-
data-in-hover-range={
|
|
18
|
+
data-in-hover-range={isInRange}
|
|
19
19
|
/>
|
|
20
20
|
))
|
|
21
21
|
return { default: mockPlot }
|
|
@@ -203,7 +203,6 @@ describe('MemoPlot', () => {
|
|
|
203
203
|
beforeEach(async () => {
|
|
204
204
|
const PlotModule = await import('../Plot/index.js')
|
|
205
205
|
MockedPlot = PlotModule.default
|
|
206
|
-
// @ts-expect-error - MockedPlot is a vitest mock function
|
|
207
206
|
MockedPlot.mockClear()
|
|
208
207
|
})
|
|
209
208
|
|