Skip to content

Commit

Permalink
feat(#491): define grape varieties
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Apr 16, 2024
1 parent d099787 commit c6bd9e0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/data/crops/grape.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/** @typedef {import("../../index").farmhand.cropVariety} farmhand.cropVariety */

import { crop, fromSeed, cropVariety } from '../crop'
import { cropFamily, cropType } from '../../enums'
import { cropFamily, cropType, grapeVariety } from '../../enums'

/**
* @param {farmhand.item | farmhand.cropVariety} item
Expand Down Expand Up @@ -63,6 +63,7 @@ export const grapeChardonnay = grape({
}),
name: 'Chardonnay Grape',
imageId: 'grape-green',
variety: grapeVariety.CHARDONNAY,
})

/**
Expand All @@ -75,6 +76,7 @@ export const grapeSauvignonBlanc = grape({
}),
name: 'Sauvignon Blanc Grape',
imageId: 'grape-green',
variety: grapeVariety.SAUVIGNON_BLANC,
})

/**
Expand All @@ -85,6 +87,7 @@ export const grapeSauvignonBlanc = grape({
// ...fromSeed(grapeSeed, { variantIdx: grapeSeed.growsInto?.indexOf('grape-pinot-blanc') }),
// name: 'Pinot Blanc Grape',
// imageId: 'grape-green',
// variety: grapeVariety.PINOT_BLANC,
// })

/**
Expand All @@ -95,6 +98,7 @@ export const grapeSauvignonBlanc = grape({
// ...fromSeed(grapeSeed, { variantIdx: grapeSeed.growsInto?.indexOf('grape-muscat') }),
// name: 'Muscat Grape',
// imageId: 'grape-green',
// variety: grapeVariety.MUSCAT,
// })

/**
Expand All @@ -105,6 +109,7 @@ export const grapeSauvignonBlanc = grape({
// ...fromSeed(grapeSeed, { variantIdx: grapeSeed.growsInto?.indexOf('grape-riesling') }),
// name: 'Riesling Grape',
// imageId: 'grape-green',
// variety: grapeVariety.RIESLING,
// })

/**
Expand All @@ -115,6 +120,7 @@ export const grapeSauvignonBlanc = grape({
// ...fromSeed(grapeSeed, { variantIdx: grapeSeed.growsInto?.indexOf('grape-merlot') }),
// name: 'Merlot Grape',
// imageId: 'grape-purple',
// variety: grapeVariety.MERLOT,
// })

/**
Expand All @@ -127,6 +133,7 @@ export const grapeCabernetSauvignon = grape({
}),
name: 'Cabernet Sauvignon Grape',
imageId: 'grape-purple',
variety: grapeVariety.CABERNET_SAUVIGNON,
})

/**
Expand All @@ -137,6 +144,7 @@ export const grapeCabernetSauvignon = grape({
// ...fromSeed(grapeSeed, { variantIdx: grapeSeed.growsInto?.indexOf('grape-syrah') }),
// name: 'Syrah Grape',
// imageId: 'grape-purple',
// variety: grapeVariety.SYRAH,
// })

/**
Expand All @@ -149,6 +157,7 @@ export const grapeTempranillo = grape({
}),
name: 'Tempranillo Grape',
imageId: 'grape-purple',
variety: grapeVariety.TEMPRANILLO,
})

/**
Expand All @@ -161,4 +170,5 @@ export const grapeNebbiolo = grape({
}),
name: 'Nebbiolo Grape',
imageId: 'grape-purple',
variety: grapeVariety.NEBBIOLO,
})
18 changes: 18 additions & 0 deletions src/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,21 @@ export const cowTradeRejectionReason = enumify(['REQUESTED_COW_UNAVAILABLE'])
export const cropFamily = {
GRAPE: 'GRAPE',
}

/**
* @property farmhand.module:enums.grapeVariety
* @readonly
* @enum {string}
*/
export const grapeVariety = {
CHARDONNAY: 'CHARDONNAY',
SAUVIGNON_BLANC: 'SAUVIGNON_BLANC',
PINOT_BLANC: 'PINOT_BLANC',
MUSCAT: 'MUSCAT',
RIESLING: 'RIESLING',
MERLOT: 'MERLOT',
CABERNET_SAUVIGNON: 'CABERNET_SAUVIGNON',
SYRAH: 'SYRAH',
TEMPRANILLO: 'TEMPRANILLO',
NEBBIOLO: 'NEBBIOLO',
}
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'typeface-francois-one'
import 'typeface-public-sans'

// eslint-disable-next-line no-unused-vars
import { cropFamily } from './enums'
import { cropFamily, grapeVariety } from './enums'

/**
* @typedef {import("./components/Farmhand/Farmhand").farmhand.state} farmhand.state
Expand Down Expand Up @@ -56,12 +56,14 @@ import { cropFamily } from './enums'
/**
* @typedef {farmhand.item & {
* imageId: string,
* cropFamily: cropFamily
* cropFamily: cropFamily,
* variety: string
* }} farmhand.cropVariety
/**
* @typedef {farmhand.cropVariety & {
* cropFamily: 'GRAPE'
* cropFamily: 'GRAPE',
* variety: grapeVariety
* }} farmhand.grape
*/

Expand Down

0 comments on commit c6bd9e0

Please sign in to comment.