Skip to content

Commit

Permalink
fixup! fix(project): [wip] use fully resolved import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Sep 1, 2024
1 parent 9e81f1a commit a634a88
Show file tree
Hide file tree
Showing 112 changed files with 117 additions and 117 deletions.
2 changes: 1 addition & 1 deletion api/get-market-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
getRedisClient,
getRoomData,
getRoomName,
} from '../api-etc/utils'
} from '../api-etc/utils/index.js'

const client = getRedisClient()

Expand Down
2 changes: 1 addition & 1 deletion api/post-day-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
getRedisClient,
getRoomData,
getRoomName,
} from '../api-etc/utils'
} from '../api-etc/utils/index.js'
import { random } from '../src/common/utils.js'

const client = getRedisClient()
Expand Down
2 changes: 1 addition & 1 deletion api/publish-global-market-values-to-discord.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { promisify } from 'util'
import axios from 'axios'

import { MARKET_SUMMARY_FOR_DISCORD } from '../api-etc/templates'
import { allowCors, getRedisClient, getRoomData } from '../api-etc/utils'
import { allowCors, getRedisClient, getRoomData } from '../api-etc/utils/index.js'

const client = getRedisClient()

Expand Down
2 changes: 1 addition & 1 deletion src/common/utils.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { generateValueAdjustments } from './utils'
import { generateValueAdjustments } from './utils.js'

vitest.mock('../data/maps.js')
vitest.mock('../data/items.js')
Expand Down
2 changes: 1 addition & 1 deletion src/components/Cellar/Keg.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { items, wines } from '../../img/index.js'
import FarmhandContext from '../Farmhand/Farmhand.context.js'
import { getKegValue } from '../../utils/getKegValue'
import { moneyString } from '../../utils/moneyString.js'
import { getSalePriceMultiplier } from '../../utils'
import { getSalePriceMultiplier } from '../../utils/index.js'
import { FERMENTED_CROP_NAME } from '../../templates'
import AnimatedNumber from '../AnimatedNumber'

Expand Down
2 changes: 1 addition & 1 deletion src/components/CowCard/CowCard.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { render, screen } from '@testing-library/react'

import { generateCow } from '../../utils'
import { generateCow } from '../../utils/index.js'
import { noop } from '../../utils/noop'
import { PURCHASEABLE_COW_PENS } from '../../constants.js'
import { cowColors, genders } from '../../enums.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/CowCard/Subheader/Subheader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
integerString,
isCowInBreedingPen,
nullArray,
} from '../../../utils'
} from '../../../utils/index.js'
import { memoize } from '../../../utils/memoize'
import { huggingMachine } from '../../../data/items.js'
import Bloodline from '../Bloodline'
Expand Down
2 changes: 1 addition & 1 deletion src/components/CowPen/CowPen.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { LEFT, RIGHT } from '../../constants.js'
import FarmhandContext from '../Farmhand/Farmhand.context.js'
import { pixel } from '../../img/index.js'

import { getCowDisplayName, getCowImage } from '../../utils'
import { getCowDisplayName, getCowImage } from '../../utils/index.js'

import './CowPen.sass'
import { random } from '../../common/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/CowPen/CowPen.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { shallow } from 'enzyme'

import { generateCow } from '../../utils'
import { generateCow } from '../../utils/index.js'
import { cowColors } from '../../enums.js'
import { pixel } from '../../img/index.js'
import { noop } from '../../utils/noop'
Expand Down
2 changes: 1 addition & 1 deletion src/components/CowPenContextMenu/CowPenContextMenu.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { render, screen } from '@testing-library/react'

import { generateCow } from '../../utils'
import { generateCow } from '../../utils/index.js'
import { noop } from '../../utils/noop'

import { CowPenContextMenu } from './CowPenContextMenu.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Farmhand/Farmhand.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import {
reduceByPersistedKeys,
sleep,
transformStateDataForImport,
} from '../../utils'
} from '../../utils/index.js'
import { noop } from '../../utils/noop'
import { getLevelEntitlements } from '../../utils/getLevelEntitlements'
import { memoize } from '../../utils/memoize'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import FarmhandContext from '../Farmhand/Farmhand.context.js'
import { itemsMap } from '../../data/maps.js'
import { cellarService } from '../../services/cellar.js'
import { getInventoryQuantityMap } from '../../utils/getInventoryQuantityMap'
import { integerString } from '../../utils'
import { integerString } from '../../utils/index.js'
import AnimatedNumber from '../AnimatedNumber'

import './FermentationRecipe.sass'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Field/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import QuickSelect from '../QuickSelect'
import { fieldMode } from '../../enums.js'
import tools from '../../data/tools'
import { levelAchieved } from '../../utils/levelAchieved'
import { doesInventorySpaceRemain, nullArray } from '../../utils'
import { doesInventorySpaceRemain, nullArray } from '../../utils/index.js'
import { getLevelEntitlements } from '../../utils/getLevelEntitlements'

import './Field.sass'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { achievementsMap } from '../../data/achievements.js'
import FarmhandContext from '../Farmhand/Farmhand.context.js'
import { STANDARD_LOAN_AMOUNT } from '../../constants.js'
import { stageFocusType } from '../../enums.js'
import { isDecember } from '../../utils'
import { isDecember } from '../../utils/index.js'
import { memoize } from '../../utils/memoize'
import Achievement from '../Achievement'

Expand Down
2 changes: 1 addition & 1 deletion src/components/IngredientsList/IngredientsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { object, shape, string } from 'prop-types'

import { INGREDIENTS_LIST_ITEM } from '../../templates'

import { integerString } from '../../utils'
import { integerString } from '../../utils/index.js'
import { itemsMap } from '../../data/maps.js'

export default function IngredientsList({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Inventory/Inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import FarmhandContext from '../Farmhand/Farmhand.context.js'
import Item from '../Item'
import { itemsMap } from '../../data/maps.js'
import { enumify, itemType } from '../../enums.js'
import { sortItems } from '../../utils'
import { sortItems } from '../../utils/index.js'

const {
COW_FEED,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Inventory/Inventory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { shallow } from 'enzyme'

import Item from '../Item'
import { testItem } from '../../test-utils/index.js'
import { sortItems } from '../../utils'
import { sortItems } from '../../utils/index.js'
import { carrot, carrotSeed, pumpkinSeed } from '../../data/crops/index.js'
import { carrotSoup } from '../../data/recipes.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Item/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
getResaleValue,
getSalePriceMultiplier,
integerString,
} from '../../utils'
} from '../../utils/index.js'
import { getCropLifecycleDuration } from '../../utils/getCropLifecycleDuration'
import QuantityInput from '../QuantityInput'
import AnimatedNumber from '../AnimatedNumber'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigation/DayAndProgressContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
experienceNeededForLevel,
integerString,
scaleNumber,
} from '../../utils'
} from '../../utils/index.js'
import { EXPERIENCE_GAUGE_TOOLTIP_LABEL } from '../../templates'

export function DayAndProgressContainer({ dayCount, experience, itemsSold }) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
doesInventorySpaceRemain,
integerString,
inventorySpaceConsumed,
} from '../../utils'
} from '../../utils/index.js'
import { dialogView } from '../../enums.js'
import {
DEFAULT_ROOM,
Expand Down
2 changes: 1 addition & 1 deletion src/components/OnlinePeersView/OnlinePeer/OnlinePeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CowCard from '../../CowCard'

import { moneyString } from '../../../utils/moneyString.js'
import { levelAchieved } from '../../../utils/levelAchieved'
import { getPlayerName, integerString } from '../../../utils'
import { getPlayerName, integerString } from '../../../utils/index.js'

const OnlinePeer = ({
peer: { cowOfferedForTrade, dayCount, id, experience, money },
Expand Down
2 changes: 1 addition & 1 deletion src/components/Plot/Plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography'
import classNames from 'classnames'

import FarmhandContext from '../Farmhand/Farmhand.context.js'
import { getCropLifeStage, getPlotContentType, getPlotImage } from '../../utils'
import { getCropLifeStage, getPlotContentType, getPlotImage } from '../../utils/index.js'
import { getCropLifecycleDuration } from '../../utils/getCropLifecycleDuration'
import { itemsMap, cropItemIdToSeedItemMap } from '../../data/maps.js'
import { pixel, plotStates } from '../../img/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Plot/Plot.rtl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event'

import { cropLifeStage } from '../../enums.js'
import { testCrop, testShoveledPlot } from '../../test-utils/index.js'
import { getCropFromItemId, getPlotContentFromItemId } from '../../utils'
import { getCropFromItemId, getPlotContentFromItemId } from '../../utils/index.js'
import { noop } from '../../utils/noop'
import { items } from '../../img/index.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Plot/Plot.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { shallow } from 'enzyme'

import { getPlotContentFromItemId } from '../../utils'
import { getPlotContentFromItemId } from '../../utils/index.js'
import { noop } from '../../utils/noop'
import { testCrop } from '../../test-utils/index.js'
import { pixel, plotStates } from '../../img/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/QuantityInput/QuantityInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import KeyboardArrowDown from '@mui/icons-material/KeyboardArrowDown'
import NumberFormat from 'react-number-format'
import TextField from '@mui/material/TextField/index.js'

import { integerString } from '../../utils'
import { integerString } from '../../utils/index.js'
import AnimatedNumber from '../AnimatedNumber'
import { Span } from '../Elements'

Expand Down
2 changes: 1 addition & 1 deletion src/components/QuickSelect/QuickSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import classNames from 'classnames'

import FarmhandContext from '../Farmhand/Farmhand.context.js'
import { items as itemImages, pixel } from '../../img/index.js'
import { integerString, sortItems } from '../../utils'
import { integerString, sortItems } from '../../utils/index.js'
import Toolbelt from '../Toolbelt'

import './QuickSelect.sass'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Recipe/Recipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
dollarString,
maxYieldOfRecipe,
integerString,
} from '../../utils'
} from '../../utils/index.js'
import { itemsMap } from '../../data/maps.js'
import { craftedItems } from '../../img/index.js'
import QuantityInput from '../QuantityInput'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Stage/Stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Shop from '../Shop'
import Workshop from '../Workshop'
import { Cellar } from '../Cellar'
import { stageFocusType } from '../../enums.js'
import { isOctober, isDecember } from '../../utils'
import { isOctober, isDecember } from '../../utils/index.js'

import './Stage.sass'

Expand Down
2 changes: 1 addition & 1 deletion src/components/StatsView/StatsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
getProfitRecord,
integerString,
moneyTotal,
} from '../../utils'
} from '../../utils/index.js'
import {
COW_SOLD_TOOLTIP_TEXT,
FARM_PRODUCTS_TOOLTIP_TEXT,
Expand Down
2 changes: 1 addition & 1 deletion src/components/UpgradePurchase/UpgradePurchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { array, func, number, object } from 'prop-types'
import IngredientsList from '../IngredientsList'

import { totalIngredientsInRecipe } from '../../utils/totalIngredientsInRecipe'
import { canMakeRecipe, doesInventorySpaceRemain } from '../../utils'
import { canMakeRecipe, doesInventorySpaceRemain } from '../../utils/index.js'

import { craftedItems } from '../../img/index.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/WineRecipeList/WineRecipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { itemsMap } from '../../data/maps.js'
import { wineService } from '../../services/wine.js'
import { grapeVariety } from '../../enums.js'
import { wines } from '../../img/index.js'
import { integerString } from '../../utils'
import { integerString } from '../../utils/index.js'
import { getInventoryQuantityMap } from '../../utils/getInventoryQuantityMap'
import { getYeastRequiredForWine } from '../../utils/getYeastRequiredForWine'
import FarmhandContext from '../Farmhand/Farmhand.context.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/WineRecipeList/WineRecipe.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '../../data/crops/index.js'
import { yeast } from '../../data/recipes.js'
import { GRAPES_REQUIRED_FOR_WINE } from '../../constants.js'
import { integerString } from '../../utils'
import { integerString } from '../../utils/index.js'
import { getYeastRequiredForWine } from '../../utils/getYeastRequiredForWine'

import { getKegStub } from '../../test-utils/stubs/getKegStub.js'
Expand Down
2 changes: 1 addition & 1 deletion src/data/achievements.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
isOctober,
moneyTotal,
percentageString,
} from '../utils'
} from '../utils/index.js'
import { memoize } from '../utils/memoize'
import { findInField } from '../utils/findInField'
import { addExperience } from '../game-logic/reducers/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/factories/CoalFactory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @typedef {import("../index").farmhand.item} farmhand.item */
import { coal, stone } from '../data/ores/index.js'
import { Factory } from '../interfaces/Factory'
import { chooseRandom } from '../utils'
import { chooseRandom } from '../utils/index.js'

/**
* Resource factory used for spawning coal
Expand Down
2 changes: 1 addition & 1 deletion src/factories/CoalFactory.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as utils from '../utils'
import * as utils from '../utils/index.js'
import { coal, stone } from '../data/ores/index.js'

import CoalFactory from './CoalFactory.js'
Expand Down
2 changes: 1 addition & 1 deletion src/factories/OreFactory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @typedef {import("../index").farmhand.item} farmhand.item */
import { goldOre, ironOre, bronzeOre, silverOre } from '../data/ores/index.js'
import { Factory } from '../interfaces/Factory'
import { randomChoice } from '../utils'
import { randomChoice } from '../utils/index.js'

const SPAWNABLE_ORES = [goldOre, ironOre, bronzeOre, silverOre]

Expand Down
2 changes: 1 addition & 1 deletion src/factories/ResourceFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
COAL_SPAWN_CHANCE,
STONE_SPAWN_CHANCE,
} from '../constants.js'
import { randomChoice } from '../utils'
import { randomChoice } from '../utils/index.js'
import { randomNumberService } from '../common/services/randomNumber'
// eslint-disable-next-line no-unused-vars
import { Factory } from '../interfaces/Factory'
Expand Down
6 changes: 3 additions & 3 deletions src/factories/ResourceFactory.test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { randomNumberService } from '../common/services/randomNumber'
import { itemType, toolLevel } from '../enums.js'
import { randomChoice } from '../utils'
import { randomChoice } from '../utils/index.js'

import ResourceFactory from './ResourceFactory.js'

vitest.mock('./CoalFactory.js')
vitest.mock('./OreFactory.js')
vitest.mock('./StoneFactory.js')

vitest.mock('../utils', async () => ({
...(await vitest.importActual('../utils')),
vitest.mock('../utils/index.js', async () => ({
...(await vitest.importActual('../utils/index.js')),
randomChoice: vitest.fn(),
}))

Expand Down
2 changes: 1 addition & 1 deletion src/game-logic/cows/cow-selection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event'
import { farmhandStub } from '../../test-utils/stubs/farmhandStub'
import { saveDataStubFactory } from '../../test-utils/stubs/saveDataStubFactory'
import { previousView } from '../../test-utils/ui'
import { generateCow, getCowDisplayName } from '../../utils'
import { generateCow, getCowDisplayName } from '../../utils/index.js'

describe('cow selection', () => {
let cowDisplayName1 = null
Expand Down
2 changes: 1 addition & 1 deletion src/game-logic/reducers/addExperience.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { experienceNeededForLevel } from '../../utils'
import { experienceNeededForLevel } from '../../utils/index.js'

import { addExperience } from './addExperience.js'

Expand Down
2 changes: 1 addition & 1 deletion src/game-logic/reducers/addItemToInventory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inventorySpaceRemaining } from '../../utils'
import { inventorySpaceRemaining } from '../../utils/index.js'

/**
* Only adds as many items as there is room in the inventory for unless
Expand Down
2 changes: 1 addition & 1 deletion src/game-logic/reducers/addRevenue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { moneyTotal } from '../../utils'
import { moneyTotal } from '../../utils/index.js'

// TODO: Add tests for this reducer
/**
Expand Down
2 changes: 1 addition & 1 deletion src/game-logic/reducers/adjustLoan.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { moneyTotal } from '../../utils'
import { moneyTotal } from '../../utils/index.js'
import { LOAN_INCREASED, LOAN_PAYOFF } from '../../templates'

import { showNotification } from './showNotification.js'
Expand Down
2 changes: 1 addition & 1 deletion src/game-logic/reducers/applyCrows.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { random } from '../../common/utils.js'
import { doesPlotContainCrop } from '../../utils'
import { doesPlotContainCrop } from '../../utils/index.js'
import { CROW_CHANCE, MAX_CROWS } from '../../constants.js'
import { CROWS_DESTROYED } from '../../templates'

Expand Down
2 changes: 1 addition & 1 deletion src/game-logic/reducers/applyLoanInterest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { castToMoney, moneyTotal } from '../../utils'
import { castToMoney, moneyTotal } from '../../utils/index.js'
import { LOAN_INTEREST_RATE } from '../../constants.js'
import { LOAN_BALANCE_NOTIFICATION } from '../../templates'

Expand Down
Loading

0 comments on commit a634a88

Please sign in to comment.