Skip to content

Commit

Permalink
feat(food): new module (#2484)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Mayer <matt@matthewmayer.co.uk>
Co-authored-by: Matt Mayer <152770+matthewmayer@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 11, 2024
1 parent 0e4b93f commit 9aab7c2
Show file tree
Hide file tree
Showing 22 changed files with 1,359 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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/generate-locales.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
53 changes: 53 additions & 0 deletions src/definitions/food.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import type { LocaleEntry } from './definitions';

export type FoodDefinition = LocaleEntry<{
/**
* Common food adjectives.
*/
adjective: string[];

/**
* List of description patterns.
*/
description_pattern: string[];

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

/**
* List of dish patterns.
*/
dish_pattern: 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[];

/**
* Common meat names.
*/
meat: 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 @@ -30,6 +30,7 @@ export type {
FinanceDefinition,
/** @deprecated Use FinanceDefinition instead */
FinanceDefinition as FinanceDefinitions,
FoodDefinition,
HackerDefinition,
/** @deprecated Use HackerDefinition instead */
HackerDefinition as HackerDefinitions,
Expand Down Expand Up @@ -101,6 +102,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
22 changes: 22 additions & 0 deletions src/locales/en/food/adjective.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default [
'bitter',
'creamy',
'crispy',
'crunchy',
'delicious',
'fluffy',
'fresh',
'golden',
'juicy',
'moist',
'rich',
'salty',
'savory',
'smoky',
'sour',
'spicy',
'sweet',
'tangy',
'tender',
'zesty',
];
23 changes: 23 additions & 0 deletions src/locales/en/food/description_pattern.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default [
'A classic pie filled with delicious {{food.meat}} and {{food.adjective}} {{food.ingredient}}, baked in a {{food.adjective}} pastry crust and topped with a golden-brown lattice.',
'A delightful tart combining {{food.adjective}} {{food.vegetable}} and sweet {{food.fruit}}, set in a buttery pastry shell and finished with a hint of {{food.spice}}.',
'A heartwarming {{food.ethnic_category}} soup, featuring fresh {{food.ingredient}} and an aromatic blend of traditional spices.',
'A robust {{food.adjective}} stew featuring {{food.ethnic_category}} flavors, loaded with {{food.adjective}} meat, {{food.adjective}} vegetables, and a {{food.adjective}}, {{food.adjective}} broth.',
'A simple {{food.fruit}} pie. No fancy stuff. Just pie.',
'A slow-roasted {{animal.bird}} with a {{food.adjective}}, {{food.adjective}} exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.',
'A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.',
'A succulent {{food.meat}} steak, encased in a {{food.adjective}} {{food.spice}} crust, served with a side of {{food.spice}} mashed {{food.vegetable}}.',
'An exquisite {{food.meat}} roast, infused with the essence of {{food.fruit}}, slow-roasted to bring out its natural flavors and served with a side of creamy {{food.vegetable}}',
'Baked {{food.ingredient}}-stuffed {{food.meat}}, seasoned with {{food.spice}} and {{food.adjective}} herbs, accompanied by roasted {{food.vegetable}} medley.',
'Crispy fried {{food.meat}} bites, seasoned with {{food.spice}} and served with a tangy {{food.fruit}} dipping sauce.',
'Fresh mixed greens tossed with {{food.spice}}-rubbed {{food.meat}}, {{food.vegetable}}, and a light dressing.',
'Fresh {{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream',
'Grilled {{food.meat}} kebabs, marinated in {{food.ethnic_category}} spices and served with a fresh {{food.vegetable}} and {{food.fruit}} salad.',
'Hearty {{food.ingredient}} and {{food.meat}} stew, slow-cooked with {{food.spice}} and {{food.vegetable}} for a comforting, flavorful meal.',
'Juicy {{food.meat}}, grilled to your liking and drizzled with a bold {{food.spice}} sauce, served alongside roasted {{food.vegetable}}.',
'Our {{food.adjective}} {{food.meat}}, slow-cooked to perfection, accompanied by steamed {{food.vegetable}} and a rich, savory gravy.',
'Tender {{food.meat}} skewers, glazed with a sweet and tangy {{food.fruit}} sauce, served over a bed of fragrant jasmine rice.',
'Tenderly braised {{food.meat}} in a rich {{food.spice}} and {{food.vegetable}} sauce, served with a side of creamy {{food.vegetable}}.',
'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}}.',
'{{number.int({"min":1, "max":99})}}-day aged {{food.meat}} steak, with choice of {{number.int({"min":2, "max":4})}} sides.',
];
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 [
'California maki',
'Peking duck',
'Philadelphia maki',
'arepas',
'barbecue ribs',
'bruschette with tomato',
'bunny chow',
'caesar salad',
'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 and beans',
'pasta carbonara',
'pasta with tomato and basil',
'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',
];
17 changes: 17 additions & 0 deletions src/locales/en/food/dish_pattern.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default [
'{{food.adjective}} {{food.ethnic_category}} stew',
'{{food.adjective}} {{food.meat}} with {{food.vegetable}}',
'{{food.ethnic_category}} {{food.ingredient}} soup',
'{{food.fruit}} and {{food.fruit}} tart',
'{{food.fruit}} pie',
'{{food.fruit}}-glazed {{food.meat}} skewers',
'{{food.fruit}}-infused {{food.meat}} roast',
'{{food.ingredient}} and {{food.meat}} pie',
'{{food.ingredient}}-infused {{food.meat}}',
'{{food.meat}} steak',
'{{food.meat}} with {{food.fruit}} sauce',
'{{food.spice}}-crusted {{food.meat}}',
'{{food.spice}}-rubbed {{food.meat}} salad',
'{{food.vegetable}} salad',
"{{person.first_name}}'s special {{food.ingredient}}",
];
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',
'American',
'Andhra',
'Anglo-Indian',
'Arab',
'Argentine',
'Armenian',
'Assyrian',
'Awadhi',
'Azerbaijani',
'Balochi',
'Bangladeshi',
'Bashkir',
'Belarusian',
'Bengali',
'Berber',
'Brazilian',
'British',
'Buddhist',
'Bulgarian',
'Cajun',
'Cantonese',
'Caribbean',
'Chechen',
'Chinese',
'Chinese Islamic',
'Circassian',
'Crimean Tatar',
'Cypriot',
'Czech',
'Danish',
'Egyptian',
'English',
'Eritrean',
'Estonian',
'Ethiopian',
'Filipino',
'French',
'Georgian',
'German',
'Goan',
'Goan Catholic',
'Greek',
'Gujarati',
'Hyderabad',
'Indian',
'Indian Chinese',
'Indian Singaporean',
'Indonesian',
'Inuit',
'Irish',
'Italian',
'Italian-American',
'Jamaican',
'Japanese',
'Jewish - Israeli',
'Karnataka',
'Kazakh',
'Keralite',
'Korean',
'Kurdish',
'Laotian',
'Latvian',
'Lebanese',
'Lithuanian',
'Louisiana Creole',
'Maharashtrian',
'Malay',
'Malaysian Chinese',
'Malaysian Indian',
'Mangalorean',
'Mediterranean',
'Mennonite',
'Mexican',
'Mordovian',
'Mughal',
'Native American',
'Nepalese',
'New Mexican',
'Odia',
'Pakistani',
'Parsi',
'Pashtun',
'Pennsylvania Dutch',
'Peranakan',
'Persian',
'Peruvian',
'Polish',
'Portuguese',
'Punjabi',
'Québécois',
'Rajasthani',
'Romani',
'Romanian',
'Russian',
'Sami',
'Serbian',
'Sindhi',
'Slovak',
'Slovenian',
'Somali',
'South Indian',
'Soviet',
'Spanish',
'Sri Lankan',
'Taiwanese',
'Tamil',
'Tatar',
'Texan',
'Thai',
'Turkish',
'Udupi',
'Ukrainian',
'Vietnamese',
'Yamal',
'Zambian',
'Zanzibari',
];

0 comments on commit 9aab7c2

Please sign in to comment.