Skip to content

Commit

Permalink
Add experimental section to enable export as png feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kpicaza committed Oct 15, 2023
1 parent b026e38 commit 63d3f4d
Show file tree
Hide file tree
Showing 18 changed files with 1,939 additions and 252 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ provides the tools you need.

### Export Sketches

* [x] Add Export to PNG (Experimental)
* [ ] Add Export to PNG, WEBP, JPG..

### Edit Sketches
Expand Down
24 changes: 24 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace App\Providers;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Tools\DsnParser;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use Native\Laravel\Dialog;
use OpenSketch\SketchBook\Domain\SketchBookRepository;
Expand Down Expand Up @@ -33,6 +37,26 @@ public function register(): void
LaravelDialogProvider::class
);

if ('test' === env('APP_ENV')) {
return;
}

$this->app->bind(Connection::class, function (): Connection {
$dsnParser = new DsnParser();
$connectionParams = $dsnParser->parse(
sprintf(
'pdo-%s:///%s/%s',
/** @phpstan-ignore-next-line */
env('DB_CONNECTION'),
base_path(),
/** @phpstan-ignore-next-line */
env('DB_DATABASE')
)
);

return DriverManager::getConnection($connectionParams);
});

$this->app->bind(PutSketchBook::class);
$this->app->bind(GetSketchBook::class);
$this->app->bind(Dialog::class, fn() => Dialog::new());
Expand Down
188 changes: 98 additions & 90 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,92 +1,100 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"nativephp/electron": "^0.4.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"icanhazstring/composer-unused": "^0.8.10",
"infection/infection": "^0.27.4",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^2.0",
"phpro/grumphp": "^2.1",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4",
"spatie/laravel-ignition": "^2.0",
"squizlabs/php_codesniffer": "^3.7"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"OpenSketch\\": "src/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"check-all": [
"@cs-check",
"@test",
"@stan",
"@infection",
"@unused"
],
"check-precommit": [
"@cs-check",
"@test",
"@stan"
],
"test": "phpunit",
"stan": "phpstan analyse app src tests --level=9",
"infection": "infection -j8",
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"unused": "composer-unused"
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true,
"phpro/grumphp": true,
"infection/extension-installer": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"require": {
"php": "^8.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"nativephp/electron": "^0.4.0",
"nyholm/psr7": "^1.8",
"pheature/dbal-toggle": "^0.7.1",
"pheature/laravel-toggle": "^0.7.2",
"pheature/toggle-crud-psr7-api": "^0.7.2",
"symfony/psr-http-message-bridge": "^2.3"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"icanhazstring/composer-unused": "^0.8.10",
"infection/infection": "^0.27.4",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^2.0",
"phpro/grumphp": "^2.1",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4",
"spatie/laravel-ignition": "^2.0",
"squizlabs/php_codesniffer": "^3.7"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"OpenSketch\\": "src/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"check-all": [
"@cs-check",
"@test",
"@stan",
"@infection",
"@unused"
],
"check-precommit": [
"@cs-check",
"@test",
"@stan"
],
"test": "phpunit",
"stan": "phpstan analyse app src tests --level=9",
"infection": "infection -j8",
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"unused": "composer-unused"
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true,
"phpro/grumphp": true,
"infection/extension-installer": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}
Loading

0 comments on commit 63d3f4d

Please sign in to comment.