Skip to content
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

Major release v4 #329

Open
wants to merge 147 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
5787019
Remove collection import
karlomikus Aug 5, 2024
d7133d9
Remove importing from legacy versions
karlomikus Aug 5, 2024
2ff370e
Updates to draft2
karlomikus Aug 5, 2024
7233906
Include prices in datapack
karlomikus Aug 5, 2024
4d4a6b2
Rename class
karlomikus Aug 5, 2024
efcbbdd
Update to pb decoder
karlomikus Aug 7, 2024
02d2a62
Merge branch 'develop' into v4dev
karlomikus Aug 9, 2024
d159f8c
Update shelf endpoints
karlomikus Aug 10, 2024
e91456a
Add ingredients cocktails endpoint
karlomikus Aug 10, 2024
2ad2d0f
Move recommend endpoint
karlomikus Aug 10, 2024
5026f29
Grouped auth endpoints
karlomikus Aug 10, 2024
ed0f4db
Update shopping list endpoints
karlomikus Aug 10, 2024
60f9c7e
Update collections endpoint
karlomikus Aug 10, 2024
acbbbf1
Update ratings
karlomikus Aug 10, 2024
35c0bc1
Merge branch 'develop' into v4dev
karlomikus Aug 10, 2024
4ab9087
Change price type
karlomikus Aug 10, 2024
4e76a4a
Use enum for ability parsing
karlomikus Aug 10, 2024
a9398c4
Add quantity to shopping list
karlomikus Aug 10, 2024
8084738
Update shopping list template
karlomikus Aug 10, 2024
f577992
csfix
karlomikus Aug 10, 2024
9d5e6a6
Convert images to webp
karlomikus Aug 11, 2024
6da3cfa
Move image service namespace
karlomikus Aug 11, 2024
6270d25
Add hash test
karlomikus Aug 11, 2024
2afd44c
Refactor meilisearch token handling
karlomikus Aug 12, 2024
f12442d
Added file tokens
karlomikus Aug 12, 2024
68748ac
Update date formats
karlomikus Aug 12, 2024
8b99a13
Add ingredient substitutes endpoint
karlomikus Aug 13, 2024
5428484
Update date formats
karlomikus Aug 13, 2024
3b13dc7
Split import and scrape endpoints
karlomikus Aug 13, 2024
e0e0c25
Ref prod url
karlomikus Aug 13, 2024
2b401a1
Update shopping list request schema
karlomikus Aug 13, 2024
a8f804a
Remove unused
karlomikus Aug 13, 2024
987400c
Update basic ingredient schema
karlomikus Aug 13, 2024
5165a34
Update includes
karlomikus Aug 13, 2024
b7a3c96
Update export types
karlomikus Aug 14, 2024
8655ecd
Update schema
karlomikus Aug 14, 2024
22c824f
Add bar id header
karlomikus Aug 14, 2024
48020fc
Update spec
karlomikus Aug 15, 2024
6fbce73
Update schema
karlomikus Aug 15, 2024
2e566cb
Add price schema
karlomikus Aug 16, 2024
8cebb0b
Update collections schema
karlomikus Aug 16, 2024
544ff77
Update importing from datapack
karlomikus Aug 17, 2024
7ade68a
Fix test namespace
karlomikus Aug 17, 2024
3a8c7ea
Add nested set support to ingredient categories
karlomikus Aug 17, 2024
3caea10
Update new dockerfile
karlomikus Aug 17, 2024
39c6599
Updated docker image
karlomikus Aug 18, 2024
485429b
Update templates
karlomikus Aug 18, 2024
19e179e
Update exports with multiple types
karlomikus Aug 19, 2024
42dc268
Export substitutes
karlomikus Aug 19, 2024
38d4ce3
Add import from file
karlomikus Aug 19, 2024
1d304d8
Consolidate export models into one
karlomikus Aug 21, 2024
fff3b41
Optimize queries
karlomikus Aug 21, 2024
9b99182
Move to libvips
karlomikus Aug 22, 2024
3e57461
Update shelf tests
karlomikus Aug 22, 2024
f5d5db8
Update image tests
karlomikus Aug 22, 2024
0eb0808
Update glass tests
karlomikus Aug 22, 2024
0a885d4
Update auth tests
karlomikus Aug 22, 2024
8967c1e
Update method tests
karlomikus Aug 22, 2024
82bfc3c
Update shopping list tests
karlomikus Aug 22, 2024
ad48d67
Update tests
karlomikus Aug 23, 2024
ce94edb
Update ingredient tests
karlomikus Aug 23, 2024
e887240
Update server tests
karlomikus Aug 23, 2024
ce4ef38
Update rating tests
karlomikus Aug 23, 2024
53e64c0
Remove unused
karlomikus Aug 23, 2024
653e31c
Update imports
karlomikus Aug 23, 2024
262857d
Add copy tests
karlomikus Aug 24, 2024
8602875
Document bar stats
karlomikus Aug 24, 2024
d8dddee
Merge branch 'develop' into v4dev
karlomikus Aug 24, 2024
4a67277
Add shelf tests
karlomikus Aug 24, 2024
760fad2
Return webp thumb
karlomikus Aug 25, 2024
2c0fd96
update docs
karlomikus Aug 25, 2024
242e36f
Update request obj
karlomikus Aug 25, 2024
336fd45
Fix missing prop
karlomikus Aug 25, 2024
19cdb15
Add more props to ingredient schema
karlomikus Aug 25, 2024
3c0b916
Refactor
karlomikus Aug 25, 2024
f39bfbe
Merge branch 'develop' into v4dev
karlomikus Aug 26, 2024
0709266
Add more matching tests
karlomikus Aug 26, 2024
46e6703
Update stats tests
karlomikus Aug 26, 2024
f3a4dfa
Update shelf request
karlomikus Aug 26, 2024
a548b5e
Update ingredient schema
karlomikus Aug 27, 2024
b19783f
Include substitutes in ingredient filter #321
karlomikus Aug 27, 2024
97ca2fb
Update spec
karlomikus Aug 28, 2024
91b6e7d
Update spec
karlomikus Aug 28, 2024
9eeb3b5
Add image fallbacks
karlomikus Sep 1, 2024
6af8ee2
Unit can be null
karlomikus Sep 1, 2024
6457dad
Update spec
karlomikus Sep 1, 2024
012b599
Update unprivileged image
karlomikus Sep 1, 2024
0e7b076
Use file uri for datapack export
karlomikus Sep 1, 2024
35857bd
Update image scraping
karlomikus Sep 4, 2024
1fb6b4f
Update public cocktail response
karlomikus Sep 4, 2024
2e665bf
Update export types
karlomikus Sep 5, 2024
bf8d4bd
Allow unit conversion for exports
karlomikus Sep 5, 2024
a984c4e
Target new data
karlomikus Sep 5, 2024
d153d37
Merge pull request #325 from karlomikus/master
karlomikus Sep 5, 2024
a500cab
Make unprivileged image main
karlomikus Sep 5, 2024
5a40e31
Remove unused
karlomikus Sep 7, 2024
b4d3c3f
Add image validation
karlomikus Sep 7, 2024
b930211
Update tests
karlomikus Sep 7, 2024
1e950f4
Update scraper tests
karlomikus Sep 7, 2024
e3e700c
Update dev env
karlomikus Sep 7, 2024
3a31832
Merge pull request #324 from karlomikus/v4dev
karlomikus Sep 7, 2024
872e6da
Remove imagick ext
karlomikus Sep 7, 2024
d3189f4
Move artisan commands
karlomikus Sep 7, 2024
49bb43f
Add missing startup scripts
karlomikus Sep 7, 2024
c45714b
Update paths
karlomikus Sep 7, 2024
c249425
Fallback to root temp
karlomikus Sep 7, 2024
67a056e
Rename sh
karlomikus Sep 7, 2024
fda6709
Remove chown
karlomikus Sep 7, 2024
a81f32b
Run migrations first
karlomikus Sep 7, 2024
76ba655
Use path from env
karlomikus Sep 8, 2024
289406e
Update order
karlomikus Sep 8, 2024
e3f6da9
Update message
karlomikus Sep 8, 2024
c287b12
Add export tests
karlomikus Sep 9, 2024
8700486
Remove env flag
karlomikus Sep 10, 2024
af964c4
Update deps
karlomikus Sep 10, 2024
33d8265
Convert export units
karlomikus Sep 10, 2024
3b30953
Change unit on share
karlomikus Sep 10, 2024
f6b1c29
Relative export url
karlomikus Sep 10, 2024
7d4e8cd
Handle cli exports
karlomikus Sep 10, 2024
fcbf20a
Add more tests
karlomikus Sep 11, 2024
1e9e43f
Fix static analysis errors
karlomikus Sep 11, 2024
41cf284
Update phpstan level
karlomikus Sep 12, 2024
5eaee1a
Update spec
karlomikus Sep 12, 2024
2165d44
Add array types
karlomikus Sep 12, 2024
0ace68f
Update image update handling
karlomikus Sep 12, 2024
57aefd0
Update tests
karlomikus Sep 12, 2024
d36c7c5
Add from datapack test
karlomikus Sep 12, 2024
60a54c2
Improve export import ui
karlomikus Sep 12, 2024
fb7c5ef
Add version checker
karlomikus Sep 12, 2024
71103e9
Update spec
karlomikus Sep 12, 2024
10e2d88
Allow slug updates #295
karlomikus Sep 12, 2024
fef22cf
Move DTO to schema
karlomikus Sep 13, 2024
d01efa9
Update spec
karlomikus Sep 13, 2024
444fa34
Move dto to ingredient schema
karlomikus Sep 13, 2024
605de8e
Move cocktail dto to schema
karlomikus Sep 13, 2024
5625edb
Update validation
karlomikus Sep 14, 2024
6d170d6
Update spec path
karlomikus Sep 14, 2024
4080b2e
Fix filepath
karlomikus Sep 14, 2024
4b08cf6
Update spec
karlomikus Sep 16, 2024
57d7bca
Cleanup old entrypoint
karlomikus Sep 18, 2024
1213af3
Disable opcache in dev, disable access log in prod
karlomikus Sep 18, 2024
2329092
Update prod ini to remove duplicates
karlomikus Sep 18, 2024
3ca8b86
Merge remote-tracking branch 'origin/master' into develop
karlomikus Sep 19, 2024
5dc204f
Update deps
karlomikus Sep 19, 2024
052b56b
csfix
karlomikus Sep 19, 2024
605f74c
Update actions
karlomikus Sep 19, 2024
7a8d978
Include libvips in runner
karlomikus Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DB_CONNECTION=sqlite
DB_FOREIGN_KEYS=true

# Drivers
LOG_CHANNEL=stderr
LOG_LEVEL=warning
CACHE_DRIVER=redis
FILESYSTEM_DISK=local
Expand All @@ -25,6 +26,8 @@ REDIS_PORT=6379
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=
MEILISEARCH_KEY=
MEILISEARCH_API_KEY=
MEILISEARCH_API_KEY_UID=

# Mail
# MAIL_MAILER=
Expand Down
2 changes: 2 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ DB_DATABASE=":memory:"
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://meilisearch:7700
MEILISEARCH_KEY=masterKeyThatIsReallyReallyLong4Real
MEILISEARCH_API_KEY=
MEILISEARCH_API_KEY_UID=

SPEC_PATH=./docs

Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install libvips
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libvips42

- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: bcmath, intl, ffi
ini-values: ffi.enable=true, zend.max_allowed_stack_size=-1

- uses: actions/checkout@v4

Expand Down
93 changes: 93 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
# v4.0.0
This is a new major release. Here's a quick summary of the more interesting changes:

- Docker image is now run as an unprivileged user by default. This has various implications, so please check the migration guide for more info
- Improved API endpoint naming and structure
- Added public Bar Assistant JSON schema specification for cocktail recipes
- Data exporting is now available in multiple formats

[Migration guide](https://docs.barassistant.app/setup/migrate-to-40/)

## Breaking changes
- Minimal PHP version is now 8.3
- Removed `imagick` PHP extension
- New extensions required: `ffi`
- Removed importing cocktails from collections
- Removed importing data from Bar Assistant v2
- List all cocktails and ingredients endpoints don't have default includes anymore
- Refer to OpenAPI documentation for a list of available includes
- Shelf
- Moved `/shelf/ingredients` to `/users/{id}/ingredients`
- Changed response schema, now returns `IngredientBasic`
- Supports pagination
- Moved `/shelf/cocktails` to `/users/{id}/cocktails`
- Changed response schema, now returns `CocktailBasic`
- Supports pagination
- Moved `/shelf/cocktails/favorites` to `/users/{id}/cocktails/favorites`
- Changed response schema, now returns `CocktailBasic`
- Supports pagination
- Removed `cocktails` property from `Ingredient` schema
- Use `/ingredients/{id}/cocktails` endpoint instead
- Supports pagination
- Moved `/ingredients/recommend` to `/users/{id}/ingredients/recommend`
- Grouped `/login`, `/logout`, `/register`, `/forgot-password`, `/reset-password` and `/verify/{id}/{hash}` endpoints into `/auth`
- Shopping list
- Moved `/shopping-list` to `/users/{id}/shopping-list`
- Updated `ShoppingList` schema
- Collections
- Removed PUT `/collections/{id}/cocktails/{cocktailId}` endpoint
- Removed `/collections/{id}/share` endpoint
- Removed DELETE `/collections/{id}/cocktails/{cocktailId}` endpoint
- Removed PUT `/collections/{id}/cocktails/{cocktailId}` endpoint
- Changed POST `/collections/{id}/cocktails` endpoint to PUT `/collections/{id}/cocktails`
- Moved GET `/collections/shared` to GET `/bars/{id}/collections`
- Ratings
- Moved `/ratings/cocktails/{id}` to `/cocktails/{id}/ratings`
- Changed POST ratings response status code to 201
- Menu
- Changed `price` attribute in menu request from `string` to `integer`
- Exports
- Added POST `/exports/{id}/download` endpoint
- Used to generate a download link for an export
- Added GET `/exports/{id}/download` endpoint
- Now requires a token and an expiration date
- Authorization is not required anymore
- Used to download an export
- Import
- Importing now requires a valid JSON schema
- Removed `save` parameter from `/import/cocktail` endpoint
- Removed `main_image_id` from cocktail model
- Use `images.sort` instead
- Removed `main_image_id` from ingredient model
- Use `images.sort` instead
- Stats
- Moved `/stats` to `/bars/{id}/stats`

## New
- Introduced `Bar-Assistant-Bar-Id` header to specify bar id
- Used for all endpoints that require bar id
- You can still send `bar_id` query parameter when needed, but it is considered deprecated
- Added `/ingredients/{id}/cocktails` endpoint, lists all cocktails that use this ingredient
- Includes cocktails that use this ingredient as a substitute
- Added `/ingredients/{id}/substitutes` endpoint, lists all ingredients that are used as a substitute for this ingredient in cocktail recipes
- Introduced new export recipe schema
- Added `quantity` to shopping list ingredients
- Images are now converted to WebP format before saving to disk
- Added `/images` endpoint, this endpoint is used to list all user uploaded images
- Bar search tokens are now saved in database
- Added `/import/scrape` endpoint
- This endpoint is used to extract recipe data from a website
- Result is a JSON schema that can be imported via `/import/cocktail` endpoint
- Images in response are now base64 encoded. This allows more flexibility in image handling for the clients
- Added `used_as_substitute_for` and `can_be_substituted_with` to ingredient response

## Changes
- Recommended ingredients now take complex ingredients into consideration
- Image processing moved from Imagick to Vips
- This now requires `libvips` to be installed on the server
- You can install it via `apt-get install -y --no-install-recommends libvips42`
- This now requires `ffi` PHP extension to be installed, and some .ini tweaks
- Meilisearch client API keys are now generated via artisan command
- All dates in responses are now in ISO 8601 format
- You can now update slug of existing bar

# v3.19.1
## Fixes
- Fix missing base data in recipes export
Expand Down
101 changes: 43 additions & 58 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,92 +1,77 @@
FROM php:8.2-fpm AS php-base
FROM alpine:latest AS datapack

ARG PGID=1000
ENV PGID=${PGID}
ARG PUID=1000
ENV PUID=${PUID}
RUN apk add --no-cache git

# Add php extension manager
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
WORKDIR /app/data

RUN git clone --depth 1 --branch datapack https://github.com/bar-assistant/data.git .

RUN rm -r .git

FROM serversideup/php:8.3-fpm-nginx AS php-base

ENV S6_CMD_WAIT_FOR_SERVICES=1
ENV APP_BASE_DIR=/var/www/cocktails
ENV NGINX_WEBROOT=/var/www/cocktails/public

USER root

RUN install-php-extensions bcmath intl ffi

RUN apt update \
&& apt-get install -y \
git \
unzip \
sqlite3 \
bash \
cron \
&& chmod +x /usr/local/bin/install-php-extensions \
&& install-php-extensions imagick opcache redis zip pcntl bcmath intl \
&& echo "access.log = /dev/null" >> /usr/local/etc/php-fpm.d/www.conf \
&& apt-get install -y --no-install-recommends libvips42 \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Add composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

# Configure php
COPY ./resources/docker/dist/php.ini $PHP_INI_DIR/php.ini

WORKDIR /var/www/cocktails
USER www-data

CMD ["php-fpm"]
WORKDIR ${APP_BASE_DIR}

FROM php-base AS dist

ENV PHP_OPCACHE_ENABLE=1
ENV PHP_OPCACHE_MAX_ACCELERATED_FILES=20000
ENV PHP_OPCACHE_MEMORY_CONSUMPTION=256
ARG BAR_ASSISTANT_VERSION
ENV BAR_ASSISTANT_VERSION=${BAR_ASSISTANT_VERSION:-develop}

RUN apt update \
&& apt-get install -y \
nginx \
gosu \
supervisor \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --chmod=755 ./resources/docker/dist/init.sh /etc/entrypoint.d/99-bass.sh

WORKDIR /var/www/cocktails
COPY --chmod=755 --chown=www-data:www-data ./resources/docker/dist/nginx.conf /etc/nginx/server-opts.d/99-bass.conf

COPY . .
USER root

ADD https://github.com/bar-assistant/data.git ./resources/data
RUN docker-php-serversideup-s6-init

RUN composer install --optimize-autoloader --no-dev
USER www-data

# Configure nginx
COPY ./resources/docker/dist/nginx.conf /etc/nginx/sites-enabled/default
COPY ./resources/docker/dist/php.ini /usr/local/etc/php/conf.d/zzz-bass-php.ini

# Add container entrypoint script
COPY ./resources/docker/dist/entrypoint.sh /usr/local/bin/entrypoint
COPY --chown=www-data:www-data . .

RUN chmod +x /usr/local/bin/entrypoint \
&& chmod +x /var/www/cocktails/resources/docker/dist/run.sh \
&& sed -i "s/{{VERSION}}/$BAR_ASSISTANT_VERSION/g" ./docs/open-api-spec.yml \
&& mkdir -p /var/www/cocktails/storage/bar-assistant/ \
&& echo "* * * * * www-data cd /var/www/cocktails && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab \
&& chown -R www-data:www-data /var/www/cocktails
COPY --from=datapack --chown=www-data:www-data /app/data ./resources/data

EXPOSE 3000
RUN composer install --optimize-autoloader --no-dev \
&& sed -i "s/{{VERSION}}/$BAR_ASSISTANT_VERSION/g" ./docs/openapi-generated.yaml \
&& cp .env.dist .env

VOLUME ["/var/www/cocktails/storage/bar-assistant"]
VOLUME ["$APP_BASE_DIR/storage/bar-assistant"]

ENTRYPOINT ["entrypoint"]
FROM php-base AS dev

FROM php-base AS localdev
USER root

RUN useradd -G www-data,root -u $PUID -d /home/developer developer
RUN mkdir -p /home/developer/.composer && \
chown -R developer:developer /home/developer
ARG USER_ID=1000
ARG GROUP_ID=1000

RUN install-php-extensions xdebug

RUN echo "* * * * * developer cd /var/www/cocktails && php artisan schedule:run >> /dev/null 2>&1" >> /etc/crontab

USER developer

WORKDIR /var/www/cocktails
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \
docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx

EXPOSE 9000
RUN docker-php-serversideup-s6-init

CMD ["php-fpm"]
USER www-data
38 changes: 30 additions & 8 deletions app/Console/Commands/BarExportRecipes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
use Throwable;
use Kami\Cocktail\Models\Bar;
use Illuminate\Console\Command;
use Kami\Cocktail\External\Export\ToDataPack;
use Kami\Cocktail\Models\Export;
use Illuminate\Support\Facades\DB;

use function Laravel\Prompts\search;

use Kami\Cocktail\External\ExportTypeEnum;
use Kami\Cocktail\External\Export\ToDataPack;
use Kami\Cocktail\External\Export\ToRecipeType;
use Kami\Cocktail\External\ForceUnitConvertEnum;

class BarExportRecipes extends Command
{
Expand All @@ -17,16 +24,16 @@ class BarExportRecipes extends Command
*
* @var string
*/
protected $signature = 'bar:export-recipes {barId} {--t|type=yml : Export type}';
protected $signature = 'bar:export-recipes {barId?} {--t|type=datapack : Export type} {--u|units= : Force unit conversion when possible (none, ml, oz, cl)}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Export all recipe data (ingredients, cocktails, base data) from a single bar';
protected $description = 'Export data from a single bar. Available export types: datapack, schema, markdown, json-ld, xml, yaml';

public function __construct(private readonly ToDataPack $exporter)
public function __construct(private readonly ToDataPack $datapackExporter, private readonly ToRecipeType $recipeExporter)
{
parent::__construct();
}
Expand All @@ -37,9 +44,20 @@ public function __construct(private readonly ToDataPack $exporter)
public function handle(): int
{
$barId = (int) $this->argument('barId');
$type = $this->option('type') ?? 'yml';

$type = ExportTypeEnum::tryFrom($type);
if ($barId === 0) {
$barId = search(
'Search bars by name',
fn (string $value) => strlen($value) > 0
? DB::table('bars')->orderBy('name')->where('name', 'like', '%' . $value . '%')->pluck('name', 'id')->toArray()
: [],
scroll: 10,
required: true
);
}

$type = ExportTypeEnum::tryFrom($this->option('type') ?? 'datapack');
$units = ForceUnitConvertEnum::tryFrom($this->option('units') ?? 'none');

try {
$bar = Bar::findOrFail($barId);
Expand All @@ -49,9 +67,13 @@ public function handle(): int
return Command::FAILURE;
}

$this->output->info(sprintf('Starting recipe export from bar: %s - "%s"', $bar->id, $bar->name));
$this->line(sprintf('Starting new export (%s | %s) from bar: %s - "%s"', $type->value, $units->value, $bar->id, $bar->name));

$filename = $this->exporter->process($barId, null, $type);
if ($type === ExportTypeEnum::Datapack) {
$filename = $this->datapackExporter->process($bar->id, Export::generateFilename('datapack'), $units);
} else {
$filename = $this->recipeExporter->process($bar->id, Export::generateFilename($type->getFilenameContext()), $type, $units);
}

$this->output->success('Data exported to file: ' . $filename);

Expand Down
Loading