@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
package/dist/index.html
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
gtag('config', analyticsID)
|
|
76
76
|
})()
|
|
77
77
|
</script>
|
|
78
|
-
<script type="module" crossorigin src="./assets/index-
|
|
78
|
+
<script type="module" crossorigin src="./assets/index-CG_lY1MJ.js"></script>
|
|
79
79
|
<link rel="stylesheet" crossorigin href="./assets/index-EAmLqUoU.css">
|
|
80
80
|
<link rel="manifest" href="./manifest.webmanifest"></head>
|
|
81
81
|
<body>
|
package/dist/service-worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let
|
|
1
|
+
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let d={};const l=e=>i(e,r),t={module:{uri:r},exports:d,require:l};s[r]=Promise.all(n.map(e=>t[e]||l(e))).then(e=>(o(...e),d))}}define(["./workbox-1ef09536"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"a1c92de9c95bea8ed6f4580b9232df81"},{url:"electron.js",revision:"b0456826f47539f6c1957c3add5eb959"},{url:"assets/workbox-window.prod.es5-BIl4cyR9.js",revision:null},{url:"assets/index-EAmLqUoU.css",revision:null},{url:"assets/index-CG_lY1MJ.js",revision:null},{url:"favicon.ico",revision:"445bb19d4a8fd46eb433dd43cbdce691"},{url:"logo192.png",revision:"70746d790b8990639d1390337d77d81a"},{url:"logo512.png",revision:"b044ab46b3f33f0e2d313d961bf1f654"},{url:"logoMaskable.png",revision:"23be58ccf16df9f43658aad3da30056d"},{url:"manifest.webmanifest",revision:"3ad071a00582451c9cdeb827b37b9ebe"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
|
|
2
2
|
//# sourceMappingURL=service-worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/
|
|
1
|
+
{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/e7545006cbe4aca953a3f69db2d32c01/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {registerRoute as workbox_routing_registerRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-routing/registerRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"index.html\",\n \"revision\": \"a1c92de9c95bea8ed6f4580b9232df81\"\n },\n {\n \"url\": \"electron.js\",\n \"revision\": \"b0456826f47539f6c1957c3add5eb959\"\n },\n {\n \"url\": \"assets/workbox-window.prod.es5-BIl4cyR9.js\",\n \"revision\": null\n },\n {\n \"url\": \"assets/index-EAmLqUoU.css\",\n \"revision\": null\n },\n {\n \"url\": \"assets/index-CG_lY1MJ.js\",\n \"revision\": null\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"445bb19d4a8fd46eb433dd43cbdce691\"\n },\n {\n \"url\": \"logo192.png\",\n \"revision\": \"70746d790b8990639d1390337d77d81a\"\n },\n {\n \"url\": \"logo512.png\",\n \"revision\": \"b044ab46b3f33f0e2d313d961bf1f654\"\n },\n {\n \"url\": \"logoMaskable.png\",\n \"revision\": \"23be58ccf16df9f43658aad3da30056d\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"3ad071a00582451c9cdeb827b37b9ebe\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\")));\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","workbox_precaching_cleanupOutdatedCaches","workbox","registerRoute","workbox_routing_NavigationRoute","NavigationRoute","workbox_precaching_createHandlerBoundToURL"],"mappings":"inBAuBAA,KAAKC,iBAAiB,UAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,gBAYTC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,MAEd,CACED,IAAO,4BACPC,SAAY,MAEd,CACED,IAAO,2BACPC,SAAY,MAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,qCAEb,CAAE,GACLC,EAAAA,wBAC6BC,EAAAC,cAAC,IAAIC,EAA+BC,gBAACC,0BAA2C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeremyckahn/farmhand",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"electron": "wait-on tcp:3000 && electron .",
|
|
24
24
|
"print:crops": "npx babel-node --presets @babel/preset-env --presets babel-preset-vite src/scripts/generate-crop-table.js",
|
|
25
25
|
"lint": "eslint src --max-warnings=0",
|
|
26
|
-
"prettier": "prettier 'src/**/*.js' --write",
|
|
26
|
+
"prettier": "prettier 'src/**/*.{js,ts,tsx}' --write",
|
|
27
27
|
"preversion": "npm test",
|
|
28
28
|
"postversion": "git push && git push --tags",
|
|
29
29
|
"start": "vite --port=3000",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"sass": "^1.69.5",
|
|
88
88
|
"scss-reset": "^1.4.2",
|
|
89
89
|
"serve": "^14.2.0",
|
|
90
|
+
"typescript": "^6.0.2",
|
|
90
91
|
"vercel": "^50.10.1",
|
|
91
92
|
"vite": "^7.3.1",
|
|
92
93
|
"vite-plugin-pwa": "^1.2.0",
|
|
@@ -29,6 +29,7 @@ const MoneyNumberFormat = forwardRef(
|
|
|
29
29
|
* @param {React.Dispatch<React.SetStateAction<number>>} props.setLoanInputValue - Function to set the loan input value
|
|
30
30
|
* @param {React.ForwardedRef<unknown>} [ref] - Forwarded ref for the component
|
|
31
31
|
*/
|
|
32
|
+
// @ts-expect-error
|
|
32
33
|
({ max, min, onChange, setLoanInputValue, ...rest }, ref) => (
|
|
33
34
|
<NumberFormat
|
|
34
35
|
fixedDecimalScale
|
|
@@ -13,11 +13,13 @@ import { memoize } from '../../utils/memoize.js'
|
|
|
13
13
|
|
|
14
14
|
import './AchievementsView.sass'
|
|
15
15
|
|
|
16
|
+
// @ts-expect-error
|
|
16
17
|
const partitionAchievements = memoize(completedAchievements =>
|
|
17
18
|
achievements.reduce(
|
|
18
19
|
(acc, achievement) => {
|
|
19
20
|
acc[
|
|
20
21
|
completedAchievements[achievement.id] ? 'complete' : 'incomplete'
|
|
22
|
+
// @ts-expect-error
|
|
21
23
|
].push(achievement)
|
|
22
24
|
|
|
23
25
|
return acc
|
|
@@ -29,10 +31,10 @@ const partitionAchievements = memoize(completedAchievements =>
|
|
|
29
31
|
)
|
|
30
32
|
)
|
|
31
33
|
|
|
32
|
-
const AchievementsList = ({
|
|
34
|
+
const AchievementsList = ({ unpartitionedAchievements }) => (
|
|
33
35
|
<AccordionDetails>
|
|
34
36
|
<ul className="card-list">
|
|
35
|
-
{
|
|
37
|
+
{unpartitionedAchievements.map(achievement => (
|
|
36
38
|
<li {...{ key: achievement.id }}>
|
|
37
39
|
<Achievement {...{ achievement }} />
|
|
38
40
|
</li>
|
|
@@ -57,7 +59,7 @@ const AchievementsView = ({
|
|
|
57
59
|
<AccordionSummary>
|
|
58
60
|
<h3>Completed</h3>
|
|
59
61
|
</AccordionSummary>
|
|
60
|
-
<AchievementsList {...{
|
|
62
|
+
<AchievementsList {...{ unpartitionedAchievements: complete }} />
|
|
61
63
|
</Accordion>
|
|
62
64
|
<Divider />
|
|
63
65
|
</>
|
|
@@ -66,7 +68,7 @@ const AchievementsView = ({
|
|
|
66
68
|
<AccordionSummary>
|
|
67
69
|
<h3>Not Completed</h3>
|
|
68
70
|
</AccordionSummary>
|
|
69
|
-
<AchievementsList {...{
|
|
71
|
+
<AchievementsList {...{ unpartitionedAchievements: incomplete }} />
|
|
70
72
|
</Accordion>
|
|
71
73
|
</div>
|
|
72
74
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
// eslint-disable-next-line no-unused-vars
|
|
3
3
|
import { tween, Tweenable } from 'shifty'
|
|
4
|
-
import { func, number } from 'prop-types'
|
|
4
|
+
import { func as funcProp, number as numberProp } from 'prop-types'
|
|
5
5
|
|
|
6
|
-
const defaultFormatter = (/** @type {number} */
|
|
6
|
+
const defaultFormatter = (/** @type {number} */ num) => `${num}`
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* AnimatedNumber component that displays a number with an animation effect.
|
|
@@ -28,14 +28,15 @@ const AnimatedNumber = ({ number, formatter = defaultFormatter }) => {
|
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
if (number !== previousNumber) {
|
|
30
30
|
if (currentTweenable) {
|
|
31
|
+
// @ts-expect-error
|
|
31
32
|
currentTweenable.cancel()
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
const tweenable = tween({
|
|
35
36
|
easing: 'easeOutQuad',
|
|
36
37
|
duration: 750,
|
|
37
|
-
render: ({ number }) => {
|
|
38
|
-
setDisplayedNumber(Number(
|
|
38
|
+
render: ({ number: tweenedNumber }) => {
|
|
39
|
+
setDisplayedNumber(Number(tweenedNumber))
|
|
39
40
|
},
|
|
40
41
|
from: {
|
|
41
42
|
number: previousNumber,
|
|
@@ -43,11 +44,13 @@ const AnimatedNumber = ({ number, formatter = defaultFormatter }) => {
|
|
|
43
44
|
to: { number },
|
|
44
45
|
})
|
|
45
46
|
|
|
47
|
+
// @ts-expect-error
|
|
46
48
|
setCurrentTweenable(tweenable)
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
return () => {
|
|
50
52
|
if (currentTweenable) {
|
|
53
|
+
// @ts-expect-error
|
|
51
54
|
currentTweenable.cancel()
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -57,8 +60,8 @@ const AnimatedNumber = ({ number, formatter = defaultFormatter }) => {
|
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
AnimatedNumber.propTypes = {
|
|
60
|
-
formatter:
|
|
61
|
-
number:
|
|
63
|
+
formatter: funcProp,
|
|
64
|
+
number: numberProp.isRequired,
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
export default AnimatedNumber
|
|
@@ -34,14 +34,15 @@ const MoneyDisplay = ({ money }) => {
|
|
|
34
34
|
|
|
35
35
|
useEffect(() => {
|
|
36
36
|
if (money !== previousMoney) {
|
|
37
|
+
// @ts-expect-error
|
|
37
38
|
currentTweenable?.cancel()
|
|
38
39
|
|
|
39
40
|
const tweenable = tween({
|
|
40
41
|
easing: 'easeOutQuad',
|
|
41
42
|
duration: 750,
|
|
42
|
-
render: ({ color, money }) => {
|
|
43
|
+
render: ({ color, money: currentMoney }) => {
|
|
43
44
|
setTextColor(String(color))
|
|
44
|
-
setDisplayedMoney(Number(
|
|
45
|
+
setDisplayedMoney(Number(currentMoney))
|
|
45
46
|
},
|
|
46
47
|
from: {
|
|
47
48
|
color: money > previousMoney ? 'rgb(0, 255, 0)' : 'rgb(255, 0, 0)',
|
|
@@ -50,10 +51,12 @@ const MoneyDisplay = ({ money }) => {
|
|
|
50
51
|
to: { color: idleColor, money },
|
|
51
52
|
})
|
|
52
53
|
|
|
54
|
+
// @ts-expect-error
|
|
53
55
|
setCurrentTweenable(tweenable)
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
return () => {
|
|
59
|
+
// @ts-expect-error
|
|
57
60
|
currentTweenable?.cancel()
|
|
58
61
|
}
|
|
59
62
|
}, [currentTweenable, money, previousMoney])
|
package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.js → BailOutErrorBoundary.tsx}
RENAMED
|
@@ -19,6 +19,7 @@ class BailOutErrorBoundary extends React.Component {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
render() {
|
|
22
|
+
// @ts-expect-error
|
|
22
23
|
if (this.state.hasError) {
|
|
23
24
|
return null
|
|
24
25
|
}
|
|
@@ -27,6 +28,7 @@ class BailOutErrorBoundary extends React.Component {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
// @ts-expect-error
|
|
30
32
|
BailOutErrorBoundary.propTypes = {}
|
|
31
33
|
|
|
32
34
|
export default BailOutErrorBoundary
|
|
@@ -48,6 +48,7 @@ export const CellarInventoryTabPanel = ({ index, currentTab }) => {
|
|
|
48
48
|
.filter(term => term.length > 0)
|
|
49
49
|
|
|
50
50
|
const filteredKegs = cellarInventory.filter(keg => {
|
|
51
|
+
// @ts-expect-error
|
|
51
52
|
const item = itemsMap[keg.itemId]
|
|
52
53
|
const itemName = item.name.toLowerCase()
|
|
53
54
|
const fermentationRecipeName = `${FERMENTED_CROP_NAME}${itemName}`
|
|
@@ -74,6 +75,7 @@ export const CellarInventoryTabPanel = ({ index, currentTab }) => {
|
|
|
74
75
|
)}
|
|
75
76
|
<ul className="card-list">
|
|
76
77
|
{filteredKegs.map(keg => (
|
|
78
|
+
// @ts-expect-error
|
|
77
79
|
<li key={keg.id}>
|
|
78
80
|
<Keg keg={keg} />
|
|
79
81
|
</li>
|
|
@@ -152,6 +152,7 @@ describe('PlayerInventory', () => {
|
|
|
152
152
|
]
|
|
153
153
|
|
|
154
154
|
render(
|
|
155
|
+
// @ts-expect-error
|
|
155
156
|
<PlayerInventory {...baseItemProps} playerInventory={playerInventory} />
|
|
156
157
|
)
|
|
157
158
|
|
|
@@ -162,6 +163,7 @@ describe('PlayerInventory', () => {
|
|
|
162
163
|
})
|
|
163
164
|
|
|
164
165
|
test('shows empty inventory when no items present', () => {
|
|
166
|
+
// @ts-expect-error
|
|
165
167
|
render(<PlayerInventory {...baseItemProps} playerInventory={[]} />)
|
|
166
168
|
|
|
167
169
|
expect(screen.getByTestId('mocked-inventory')).toBeInTheDocument()
|
|
@@ -177,6 +179,7 @@ describe('PlayerInventory', () => {
|
|
|
177
179
|
]
|
|
178
180
|
|
|
179
181
|
render(
|
|
182
|
+
// @ts-expect-error
|
|
180
183
|
<PlayerInventory {...baseItemProps} playerInventory={playerInventory} />
|
|
181
184
|
)
|
|
182
185
|
|
|
@@ -16,6 +16,7 @@ export const PlayerInventory = memo(
|
|
|
16
16
|
* @param {farmhand.item[]} props.playerInventory - The array of items in the
|
|
17
17
|
* player's inventory.
|
|
18
18
|
*/
|
|
19
|
+
// @ts-expect-error
|
|
19
20
|
({ playerInventory }) => (
|
|
20
21
|
<Inventory
|
|
21
22
|
{...{
|
|
@@ -24,6 +25,7 @@ export const PlayerInventory = memo(
|
|
|
24
25
|
}}
|
|
25
26
|
/>
|
|
26
27
|
),
|
|
28
|
+
// @ts-expect-error
|
|
27
29
|
(prev, next) => prev.playerInventory === next.playerInventory
|
|
28
30
|
)
|
|
29
31
|
|
|
@@ -70,7 +70,8 @@ test('displays tooltips on hover', async () => {
|
|
|
70
70
|
|
|
71
71
|
const brownElement = document.querySelector('.brown')
|
|
72
72
|
expect(brownElement).toBeInTheDocument()
|
|
73
|
-
|
|
73
|
+
// @ts-expect-error
|
|
74
|
+
await userEvent.hover(/** @type {Element} */ brownElement)
|
|
74
75
|
|
|
75
76
|
expect(await screen.findByText('Brown')).toBeInTheDocument()
|
|
76
77
|
})
|
|
@@ -86,12 +87,14 @@ test('handles multiple color tooltips', async () => {
|
|
|
86
87
|
|
|
87
88
|
const blueElement = document.querySelector('.blue')
|
|
88
89
|
expect(blueElement).toBeInTheDocument()
|
|
89
|
-
|
|
90
|
+
// @ts-expect-error
|
|
91
|
+
await userEvent.hover(/** @type {Element} */ blueElement)
|
|
90
92
|
expect(await screen.findByText('Blue')).toBeInTheDocument()
|
|
91
93
|
|
|
92
94
|
const whiteElement = document.querySelector('.white')
|
|
93
95
|
expect(whiteElement).toBeInTheDocument()
|
|
94
|
-
|
|
96
|
+
// @ts-expect-error
|
|
97
|
+
await userEvent.hover(/** @type {Element} */ whiteElement)
|
|
95
98
|
expect(await screen.findByText('White')).toBeInTheDocument()
|
|
96
99
|
})
|
|
97
100
|
|
|
@@ -107,8 +107,8 @@ export const CowCard = (
|
|
|
107
107
|
const [cowImage, setCowImage] = useState(pixel)
|
|
108
108
|
|
|
109
109
|
// @see https://github.com/microsoft/TypeScript/issues/27387#issuecomment-659671940
|
|
110
|
-
const cardRef = useRef(/** @type {HTMLDivElement|null} */
|
|
111
|
-
const scrollAnchorRef = useRef(/** @type {HTMLAnchorElement|null} */
|
|
110
|
+
const cardRef = useRef(/** @type {HTMLDivElement|null} */ null)
|
|
111
|
+
const scrollAnchorRef = useRef(/** @type {HTMLAnchorElement|null} */ null)
|
|
112
112
|
|
|
113
113
|
const isCowPurchased =
|
|
114
114
|
!!cowInventory.find(({ id }) => id === cow.id) &&
|
|
@@ -126,11 +126,11 @@ export const CowCard = (
|
|
|
126
126
|
|
|
127
127
|
useEffect(() => {
|
|
128
128
|
;(async () => {
|
|
129
|
-
const
|
|
129
|
+
const fetchedCowImage = await getCowImage(cow)
|
|
130
130
|
|
|
131
131
|
if (isMounted() === false) return
|
|
132
132
|
|
|
133
|
-
setCowImage(
|
|
133
|
+
setCowImage(fetchedCowImage)
|
|
134
134
|
})()
|
|
135
135
|
|
|
136
136
|
setDisplayName(getCowDisplayName(cow, playerId, allowCustomPeerCowNames))
|
|
@@ -143,7 +143,9 @@ export const CowCard = (
|
|
|
143
143
|
if (!scrollAnchor || !card) return
|
|
144
144
|
|
|
145
145
|
// scrollIntoView is not defined in the unit test environment.
|
|
146
|
+
// @ts-expect-error
|
|
146
147
|
if (scrollAnchor.scrollIntoView && !isInViewport(card)) {
|
|
148
|
+
// @ts-expect-error
|
|
147
149
|
scrollAnchor.scrollIntoView({ behavior: 'smooth' })
|
|
148
150
|
}
|
|
149
151
|
}
|
|
@@ -40,11 +40,13 @@ export class Cow extends Component {
|
|
|
40
40
|
static hugAnimationDuration = 750
|
|
41
41
|
|
|
42
42
|
get waitVariance() {
|
|
43
|
+
// @ts-expect-error
|
|
43
44
|
return 2000 * this.props.cowInventory.length
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
componentDidUpdate(prevProps) {
|
|
47
48
|
if (
|
|
49
|
+
// @ts-expect-error
|
|
48
50
|
this.props.isSelected &&
|
|
49
51
|
!prevProps.isSelected &&
|
|
50
52
|
this.repositionTimeoutId !== null
|
|
@@ -52,17 +54,20 @@ export class Cow extends Component {
|
|
|
52
54
|
clearTimeout(this.repositionTimeoutId)
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
// @ts-expect-error
|
|
55
58
|
if (!this.props.isSelected && prevProps.isSelected) {
|
|
56
59
|
this.scheduleMove()
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
if (
|
|
63
|
+
// @ts-expect-error
|
|
60
64
|
this.props.cow.happinessBoostsToday >
|
|
61
65
|
prevProps.cow.happinessBoostsToday &&
|
|
62
66
|
!this.state.showHugAnimation
|
|
63
67
|
) {
|
|
64
68
|
this.setState({ showHugAnimation: true })
|
|
65
69
|
|
|
70
|
+
// @ts-expect-error
|
|
66
71
|
this.animateHugTimeoutId = setTimeout(() => {
|
|
67
72
|
if (this.isComponentMounted) {
|
|
68
73
|
this.setState({ showHugAnimation: false })
|
|
@@ -141,9 +146,9 @@ export class Cow extends Component {
|
|
|
141
146
|
from: { x, y },
|
|
142
147
|
to: { x: newX, y: randomPosition() },
|
|
143
148
|
duration: Cow.transitionAnimationDuration,
|
|
144
|
-
render: ({ x, y }) => {
|
|
149
|
+
render: ({ x: newXValue, y: newYValue }) => {
|
|
145
150
|
if (this.isComponentMounted) {
|
|
146
|
-
this.setState({ x, y })
|
|
151
|
+
this.setState({ x: newXValue, y: newYValue })
|
|
147
152
|
}
|
|
148
153
|
},
|
|
149
154
|
easing: 'linear',
|
|
@@ -165,10 +170,12 @@ export class Cow extends Component {
|
|
|
165
170
|
}
|
|
166
171
|
|
|
167
172
|
scheduleMove = () => {
|
|
173
|
+
// @ts-expect-error
|
|
168
174
|
if (this.props.isSelected) {
|
|
169
175
|
return
|
|
170
176
|
}
|
|
171
177
|
|
|
178
|
+
// @ts-expect-error
|
|
172
179
|
this.repositionTimeoutId = setTimeout(
|
|
173
180
|
this.repositionTimeoutHandler,
|
|
174
181
|
random() * this.waitVariance
|
|
@@ -179,6 +186,7 @@ export class Cow extends Component {
|
|
|
179
186
|
this.isComponentMounted = true
|
|
180
187
|
this.scheduleMove()
|
|
181
188
|
;(async () => {
|
|
189
|
+
// @ts-expect-error
|
|
182
190
|
const cowImage = await getCowImage(this.props.cow)
|
|
183
191
|
|
|
184
192
|
if (!this.isComponentMounted) return
|
|
@@ -199,10 +207,15 @@ export class Cow extends Component {
|
|
|
199
207
|
render() {
|
|
200
208
|
const {
|
|
201
209
|
props: {
|
|
210
|
+
// @ts-expect-error
|
|
202
211
|
allowCustomPeerCowNames,
|
|
212
|
+
// @ts-expect-error
|
|
203
213
|
cow,
|
|
214
|
+
// @ts-expect-error
|
|
204
215
|
handleCowClick,
|
|
216
|
+
// @ts-expect-error
|
|
205
217
|
playerId,
|
|
218
|
+
// @ts-expect-error
|
|
206
219
|
isSelected,
|
|
207
220
|
},
|
|
208
221
|
state: { cowImage, isTransitioning, rotate, showHugAnimation, x, y },
|
|
@@ -216,16 +229,16 @@ export class Cow extends Component {
|
|
|
216
229
|
|
|
217
230
|
return (
|
|
218
231
|
<div
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
232
|
+
className={classNames('cow', {
|
|
233
|
+
'is-transitioning': isTransitioning,
|
|
234
|
+
'is-selected': isSelected,
|
|
235
|
+
'is-loaded': cowImage !== pixel,
|
|
236
|
+
})}
|
|
237
|
+
onClick={() => handleCowClick(cow)}
|
|
238
|
+
style={{
|
|
239
|
+
left: `${x}%`,
|
|
240
|
+
top: `${y}%`,
|
|
241
|
+
}}
|
|
229
242
|
>
|
|
230
243
|
{isSelected && (
|
|
231
244
|
<p className="visually_hidden">{cowDisplayName} is selected</p>
|
|
@@ -259,7 +272,7 @@ export class Cow extends Component {
|
|
|
259
272
|
</div>
|
|
260
273
|
</Tooltip>
|
|
261
274
|
<ol {...{ className: 'happiness-boosts-today' }}>
|
|
262
|
-
{new Array(this.props.cow.happinessBoostsToday)
|
|
275
|
+
{new Array((this.props as any).cow.happinessBoostsToday)
|
|
263
276
|
.fill(undefined)
|
|
264
277
|
.map((_, i) => (
|
|
265
278
|
<li {...{ key: i }}>
|
|
@@ -276,6 +289,7 @@ export class Cow extends Component {
|
|
|
276
289
|
}
|
|
277
290
|
}
|
|
278
291
|
|
|
292
|
+
// @ts-expect-error
|
|
279
293
|
Cow.propTypes = {
|
|
280
294
|
allowCustomPeerCowNames: bool.isRequired,
|
|
281
295
|
cow: object.isRequired,
|
|
@@ -58,12 +58,14 @@ describe('Cow', () => {
|
|
|
58
58
|
})
|
|
59
59
|
|
|
60
60
|
test('applies selected class when cow is selected', () => {
|
|
61
|
+
// @ts-expect-error
|
|
61
62
|
render(<Cow {...defaultCowProps} isSelected={true} />)
|
|
62
63
|
|
|
63
64
|
expect(document.querySelector('.cow.is-selected')).toBeInTheDocument()
|
|
64
65
|
})
|
|
65
66
|
|
|
66
67
|
test('does not apply selected class when cow is not selected', () => {
|
|
68
|
+
// @ts-expect-error
|
|
67
69
|
render(<Cow {...defaultCowProps} isSelected={false} />)
|
|
68
70
|
|
|
69
71
|
expect(document.querySelector('.cow.is-selected')).not.toBeInTheDocument()
|
|
@@ -73,16 +75,19 @@ describe('Cow', () => {
|
|
|
73
75
|
const user = userEvent.setup({ advanceTimers: vitest.advanceTimersByTime })
|
|
74
76
|
const handleCowClick = vitest.fn()
|
|
75
77
|
|
|
78
|
+
// @ts-expect-error
|
|
76
79
|
render(<Cow {...defaultCowProps} handleCowClick={handleCowClick} />)
|
|
77
80
|
|
|
78
81
|
const cowElement = document.querySelector('.cow')
|
|
79
82
|
expect(cowElement).toBeInTheDocument()
|
|
80
|
-
|
|
83
|
+
// @ts-expect-error
|
|
84
|
+
await user.click(/** @type {HTMLElement} */ cowElement)
|
|
81
85
|
|
|
82
86
|
expect(handleCowClick).toHaveBeenCalledWith(defaultCowProps.cow)
|
|
83
87
|
})
|
|
84
88
|
|
|
85
89
|
test('displays cow tooltip on hover', () => {
|
|
90
|
+
// @ts-expect-error
|
|
86
91
|
render(<Cow {...defaultCowProps} isSelected={true} />)
|
|
87
92
|
|
|
88
93
|
// When cow is selected, tooltip should be visible
|
|
@@ -95,6 +100,7 @@ describe('Cow', () => {
|
|
|
95
100
|
happiness: 0.8,
|
|
96
101
|
}
|
|
97
102
|
|
|
103
|
+
// @ts-expect-error
|
|
98
104
|
render(<Cow {...defaultCowProps} cow={happyCow} />)
|
|
99
105
|
|
|
100
106
|
expect(document.querySelector('.fa-heart')).toBeInTheDocument()
|
|
@@ -107,6 +113,7 @@ describe('Cow', () => {
|
|
|
107
113
|
happinessBoostsToday: 0,
|
|
108
114
|
}
|
|
109
115
|
|
|
116
|
+
// @ts-expect-error
|
|
110
117
|
render(<Cow {...defaultCowProps} cow={sadCow} />)
|
|
111
118
|
|
|
112
119
|
// Check that there are no happiness boost indicators specifically
|
|
@@ -121,6 +128,7 @@ describe('Cow', () => {
|
|
|
121
128
|
color: cowColors.BROWN,
|
|
122
129
|
}
|
|
123
130
|
|
|
131
|
+
// @ts-expect-error
|
|
124
132
|
render(<Cow {...defaultCowProps} cow={brownCow} />)
|
|
125
133
|
|
|
126
134
|
expect(document.querySelector('.cow')).toBeInTheDocument()
|
|
@@ -134,6 +142,7 @@ describe('Cow', () => {
|
|
|
134
142
|
}
|
|
135
143
|
|
|
136
144
|
render(
|
|
145
|
+
// @ts-expect-error
|
|
137
146
|
<Cow {...defaultCowProps} cow={peerCow} allowCustomPeerCowNames={true} />
|
|
138
147
|
)
|
|
139
148
|
|
|
@@ -148,6 +157,7 @@ describe('Cow', () => {
|
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
render(
|
|
160
|
+
// @ts-expect-error
|
|
151
161
|
<Cow {...defaultCowProps} cow={peerCow} allowCustomPeerCowNames={false} />
|
|
152
162
|
)
|
|
153
163
|
|
|
@@ -184,9 +194,11 @@ describe('Cow', () => {
|
|
|
184
194
|
})
|
|
185
195
|
|
|
186
196
|
test('stops movement when cow is selected', () => {
|
|
197
|
+
// @ts-expect-error
|
|
187
198
|
const { rerender } = render(<Cow {...defaultCowProps} isSelected={false} />)
|
|
188
199
|
|
|
189
200
|
// Change to selected
|
|
201
|
+
// @ts-expect-error
|
|
190
202
|
rerender(<Cow {...defaultCowProps} isSelected={true} />)
|
|
191
203
|
|
|
192
204
|
const cowElement = document.querySelector('.cow')
|
|
@@ -195,9 +207,11 @@ describe('Cow', () => {
|
|
|
195
207
|
})
|
|
196
208
|
|
|
197
209
|
test('resumes movement when cow is deselected', () => {
|
|
210
|
+
// @ts-expect-error
|
|
198
211
|
const { rerender } = render(<Cow {...defaultCowProps} isSelected={true} />)
|
|
199
212
|
|
|
200
213
|
// Change to not selected
|
|
214
|
+
// @ts-expect-error
|
|
201
215
|
rerender(<Cow {...defaultCowProps} isSelected={false} />)
|
|
202
216
|
|
|
203
217
|
const cowElement = document.querySelector('.cow')
|
|
@@ -65,7 +65,7 @@ const Tumbleweed = ({ onAnimationComplete }) => {
|
|
|
65
65
|
*/
|
|
66
66
|
export const Tumbleweeds = ({ doSpawn }) => {
|
|
67
67
|
// A list of UUIDs, each representing a Tumbleweed component.
|
|
68
|
-
const [tumbleweeds, setTumbleweeds] = useState(/** @type {string[]} */
|
|
68
|
+
const [tumbleweeds, setTumbleweeds] = useState(/** @type {string[]} */ [])
|
|
69
69
|
// The current interval between tumbleweed spawns.
|
|
70
70
|
const [spawnIntervalMs, setSpawnIntervalMs] = useState(initialSpawnIntervalMs)
|
|
71
71
|
// The timestamp of the last scheduled tumbleweed spawn.
|
|
@@ -73,6 +73,7 @@ export const Tumbleweeds = ({ doSpawn }) => {
|
|
|
73
73
|
|
|
74
74
|
// Adds a new tumbleweed to the list.
|
|
75
75
|
const spawnTumbleweed = () => {
|
|
76
|
+
// @ts-expect-error
|
|
76
77
|
setTumbleweeds(oldTumbleweeds => [...oldTumbleweeds, v4()])
|
|
77
78
|
}
|
|
78
79
|
|
|
@@ -162,12 +162,12 @@ export const createContextData = () => {
|
|
|
162
162
|
todaysPurchases: {},
|
|
163
163
|
todaysRevenue: 0,
|
|
164
164
|
todaysStartingInventory: {},
|
|
165
|
-
toolLevels: /** @type {Record<globalThis.farmhand.toolType, globalThis.farmhand.toolLevel>} */
|
|
165
|
+
toolLevels: /** @type {Record<globalThis.farmhand.toolType, globalThis.farmhand.toolLevel>} */ {
|
|
166
166
|
SCYTHE: 'DEFAULT',
|
|
167
167
|
SHOVEL: 'DEFAULT',
|
|
168
168
|
HOE: 'DEFAULT',
|
|
169
169
|
WATERING_CAN: 'DEFAULT',
|
|
170
|
-
}
|
|
170
|
+
},
|
|
171
171
|
valueAdjustments: {},
|
|
172
172
|
version: '1.0.0',
|
|
173
173
|
todaysNotifications: [],
|