Skip to content

feat(food): new module #2484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const apiPages = [
{ text: 'Datatype', link: '/api/datatype.html' },
{ text: 'Date', link: '/api/date.html' },
{ text: 'Finance', link: '/api/finance.html' },
{ text: 'Food', link: '/api/food.html' },
{ text: 'Git', link: '/api/git.html' },
{ text: 'Hacker', link: '/api/hacker.html' },
{ text: 'Helpers', link: '/api/helpers.html' },
Expand Down
1 change: 1 addition & 0 deletions scripts/generateLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const definitionsTypes: DefinitionType = {
database: 'DatabaseDefinition',
date: 'DateDefinition',
finance: 'FinanceDefinition',
food: 'FoodDefinition',
hacker: 'HackerDefinition',
internet: 'InternetDefinition',
location: 'LocationDefinition',
Expand Down
2 changes: 2 additions & 0 deletions src/definitions/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { CompanyDefinition } from './company';
import type { DatabaseDefinition } from './database';
import type { DateDefinition } from './date';
import type { FinanceDefinition } from './finance';
import type { FoodDefinition } from './food';
import type { HackerDefinition } from './hacker';
import type { InternetDefinition } from './internet';
import type { LocationDefinition } from './location';
Expand Down Expand Up @@ -39,6 +40,7 @@ export type LocaleDefinition = {
database?: DatabaseDefinition;
date?: DateDefinition;
finance?: FinanceDefinition;
food?: FoodDefinition;
hacker?: HackerDefinition;
internet?: InternetDefinition;
location?: LocationDefinition;
Expand Down
38 changes: 38 additions & 0 deletions src/definitions/food.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import type { LocaleEntry } from './definitions';

export type FoodDefinition = LocaleEntry<{
/**
* List of description patterns.
*/
description_pattern: string[];

/**
* Common dish names.
*/
dish: string[];

/**
* A list of cooking styles that are commonly associated with a particular food item or recipe.
*/
ethnic_category: string[];

/**
* A list of common fruit names.
*/
fruit: string[];

/**
* Common ingredient names.
*/
ingredient: string[];

/**
* A list of common spice names.
*/
spice: string[];

/**
* A list of common vegetable names.
*/
vegetable: string[];
}>;
1 change: 1 addition & 0 deletions src/definitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type { DatabaseDefinition } from './database';
export type { DateDefinition, DateEntryDefinition } from './date';
export type { LocaleDefinition, LocaleEntry } from './definitions';
export type { FinanceDefinition } from './finance';
export type { FoodDefinition } from './food';
export type { HackerDefinition } from './hacker';
export type { InternetDefinition } from './internet';
export type { LocationDefinition } from './location';
Expand Down
2 changes: 2 additions & 0 deletions src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { CompanyModule } from './modules/company';
import { DatabaseModule } from './modules/database';
import { DateModule } from './modules/date';
import { FinanceModule } from './modules/finance';
import { FoodModule } from './modules/food';
import { GitModule } from './modules/git';
import { HackerModule } from './modules/hacker';
import { HelpersModule } from './modules/helpers';
Expand Down Expand Up @@ -75,6 +76,7 @@ export class Faker extends SimpleFaker {
readonly database: DatabaseModule = new DatabaseModule(this);
readonly date: DateModule = new DateModule(this);
readonly finance = new FinanceModule(this);
readonly food = new FoodModule(this);
readonly git: GitModule = new GitModule(this);
readonly hacker: HackerModule = new HackerModule(this);
readonly helpers: HelpersModule = new HelpersModule(this);
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type {
FinanceDefinition,
/** @deprecated Use FinanceDefinition instead */
FinanceDefinition as FinanceDefinitions,
FoodDefinition,
HackerDefinition,
/** @deprecated Use HackerDefinition instead */
HackerDefinition as HackerDefinitions,
Expand Down Expand Up @@ -100,6 +101,7 @@ export type { DatabaseModule } from './modules/database';
export type { DatatypeModule } from './modules/datatype';
export type { DateModule, SimpleDateModule } from './modules/date';
export type { Currency, FinanceModule } from './modules/finance';
export type { FoodModule } from './modules/food';
export type { GitModule } from './modules/git';
export type { HackerModule } from './modules/hacker';
export type { HelpersModule, SimpleHelpersModule } from './modules/helpers';
Expand Down
9 changes: 9 additions & 0 deletions src/locales/en/food/description_pattern.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default [
'Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.',
'{{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream',
'A slow-roasted {{animal.bird}} with a crisp, golden exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.',
'One slice of exotic {{animal.crocodilia}} meat, {{food.spice}} {{food.spice}} butter, with an additional side.',
'28-day aged 300g {{animal.cow}} steak, with choice of two sides.',
'A simple {{food.fruit}} pie. No fancy stuff. Just pie.',
'A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.',
];
56 changes: 56 additions & 0 deletions src/locales/en/food/dish.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
export default [
'Arepas',
'Barbecue Ribs',
'Bruschette with Tomato',
'Bunny Chow',
'Caesar Salad',
'California Maki',
'Caprese Salad',
'Cauliflower Penne',
'Cheeseburger',
'Chicken Fajitas',
'Chicken Milanese',
'Chicken Parm',
'Chicken Wings',
'Chilli con Carne',
'Ebiten maki',
'Fettuccine Alfredo',
'Fish and Chips',
'French Fries with Sausages',
'French Toast',
'Hummus',
'Katsu Curry',
'Kebab',
'Lasagne',
'Linguine with Clams',
'Massaman Curry',
'Meatballs with Sauce',
'Mushroom Risotto',
'Pappardelle alla Bolognese',
'Pasta Carbonara',
'Pasta and Beans',
'Pasta with Tomato and Basil',
'Peking Duck',
'Philadelphia Maki',
'Pho',
'Pierogi',
'Pizza',
'Poke',
'Pork Belly Buns',
'Pork Sausage Roll',
'Poutine',
'Ricotta Stuffed Ravioli',
'Risotto with Seafood',
'Salmon Nigiri',
'Scotch Eggs',
'Seafood Paella',
'Som Tam',
'Souvlaki',
'Stinky Tofu',
'Sushi',
'Tacos',
'Teriyaki Chicken Donburi',
'Tiramisù',
'Tuna Sashimi',
'Vegetable Soup',
];
120 changes: 120 additions & 0 deletions src/locales/en/food/ethnic_category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
export default [
'Ainu',
'Albanian',
'Argentine',
'Andhra',
'American',
'Anglo-Indian',
'Arab',
'Armenian',
'Assyrian',
'Awadhi',
'Azerbaijani',
'Balochi',
'Bashkir',
'Belarusian',
'Bangladeshi',
'Bengali',
'Berber',
'Brazilian',
'British',
'Buddhist',
'Bulgarian',
'Cajun',
'Cantonese',
'Caribbean',
'Chechen',
'Chinese cuisine',
'Chinese Islamic',
'Circassian',
'Crimean Tatar',
'Cypriot',
'Czech',
'Danish',
'Egyptian',
'English',
'Ethiopian',
'Eritrean',
'Estonian',
'French',
'Filipino',
'Georgian',
'German',
'Goan',
'Goan Catholic',
'Greek',
'Gujarati',
'Hyderabad',
'Indian cuisine',
'Indian Chinese',
'Indian Singaporean cuisine',
'Indonesian',
'Inuit',
'Irish',
'Italian-American',
'Italian cuisine',
'Jamaican',
'Japanese',
'Jewish - Israeli',
'Karnataka',
'Kazakh',
'Keralite',
'Korean',
'Kurdish',
'Laotian',
'Lebanese',
'Latvian',
'Lithuanian',
'Louisiana Creole',
'Maharashtrian',
'Mangalorean',
'Malay',
'Malaysian Chinese cuisine',
'Malaysian Indian cuisine',
'Mediterranean cuisine',
'Mennonite',
'Mexican',
'Mordovian',
'Mughal',
'Native American',
'Nepalese',
'New Mexican',
'Odia',
'Parsi',
'Pashtun',
'Polish',
'Pennsylvania Dutch',
'Pakistani',
'Peranakan',
'Persian',
'Peruvian',
'Portuguese',
'Punjabi',
'Québécois',
'Rajasthani',
'Romani',
'Romanian',
'Russian',
'Sami',
'Serbian',
'Sindhi',
'Slovak',
'Slovenian',
'Somali',
'South Indian',
'Soviet',
'Spanish',
'Sri Lankan',
'Taiwanese',
'Tatar',
'Texan',
'Thai',
'Turkish',
'Tamil',
'Udupi',
'Ukrainian',
'Vietnamese',
'Yamal',
'Zambian',
'Zanzibari',
];
71 changes: 71 additions & 0 deletions src/locales/en/food/fruit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
export default [
'Apples',
'Apricots',
'Aubergine',
'Avocado',
'Banana',
'Berries',
'Blackberries',
'Blood oranges',
'Blueberries',
'Bush Tomato',
'Butternut pumpkin',
'Cantaloupe',
'Cavalo',
'Starfruit',
'Cherries',
'Corella Pear',
'Cranberry',
'Cumquat',
'Currants',
'Custard Apples',
'Custard Apples Daikon',
'Dates',
'Dragonfruit',
'Dried Apricots',
'Elderberry',
'Feijoa',
'Grapefruit',
'Grapes',
'Figs',
'Fingerlime',
'Goji Berry',
'Guava',
'Honeydew melon',
'Incaberries',
'Jarrahdale pumpkin',
'Juniper Berries',
'Kiwi Fruit',
'Kiwiberries',
'Lemon',
'Limes',
'Longan',
'Loquats',
'Lychees',
'Mango',
'Mangosteens',
'Melon',
'Mandarins',
'Mulberries',
'Nashi Pear',
'Nectarines',
'Olives',
'Oranges',
'Papaw',
'Papaya',
'Passionfruit',
'Peaches',
'Pears',
'Pineapple',
'Pomegranate',
'Plums',
'Prunes',
'Rockmelon',
'Snowpeas',
'Sprouts',
'Strawberries',
'Sultanas',
'Tangelo',
'Tomatoes',
'Watermelon',
];
24 changes: 24 additions & 0 deletions src/locales/en/food/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* This file is automatically generated.
* Run 'pnpm run generate:locales' to update.
*/
import type { FoodDefinition } from '../../..';
import description_pattern from './description_pattern';
import dish from './dish';
import ethnic_category from './ethnic_category';
import fruit from './fruit';
import ingredient from './ingredient';
import spice from './spice';
import vegetable from './vegetable';

const food: FoodDefinition = {
description_pattern,
dish,
ethnic_category,
fruit,
ingredient,
spice,
vegetable,
};

export default food;
Loading