From 8e4a6d6a70abe1ab696f5299e3b3c04a643f9d9d Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Mon, 26 Jun 2023 09:04:16 +0200 Subject: [PATCH] Pin working version `0.1.20` of `@graphiql/plugin-explorer` Resolves https://github.com/mll-lab/laravel-graphiql/issues/25 --- CHANGELOG.md | 6 ++++++ phpstan.neon | 1 + src/DownloadAssetsCommand.php | 11 ++++++----- views/index.blade.php | 26 +++++++++++++++----------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a93219..52be2c1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ See [GitHub releases](https://github.com/mll-lab/laravel-graphiql/releases). ## Unreleased +## v3.0.2 + +### Fixed + +- Pin working version `0.1.20` of `@graphiql/plugin-explorer` + ## v3.0.1 ### Fixed diff --git a/phpstan.neon b/phpstan.neon index b2a0821..c960dcd 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,4 +3,5 @@ parameters: paths: - src - views + - .php-cs-fixer.php checkOctaneCompatibility: true diff --git a/src/DownloadAssetsCommand.php b/src/DownloadAssetsCommand.php index 3131cc0..ef44460 100755 --- a/src/DownloadAssetsCommand.php +++ b/src/DownloadAssetsCommand.php @@ -19,8 +19,9 @@ class DownloadAssetsCommand extends Command public const JS_PATH_LOCAL = 'vendor/graphiql/graphiql.min.js'; public const JS_PATH_CDN = '//unpkg.com/graphiql/graphiql.min.js'; - public const EXPLORER_PLUGIN_PATH_LOCAL = 'vendor/graphiql/graphiql-plugin-explorer.umd.js'; - public const EXPLORER_PLUGIN_PATH_CDN = '//unpkg.com/@graphiql/plugin-explorer/dist/graphiql-plugin-explorer.umd.js'; + public const PLUGIN_EXPLORER_PATH_LOCAL = 'vendor/graphiql/graphiql-plugin-explorer.umd.js'; + /** Pinned because the latest version broke, see https://github.com/mll-lab/laravel-graphiql/issues/25. */ + public const PLUGIN_EXPLORER_PATH_CDN = '//unpkg.com/@graphiql/plugin-explorer@0.1.20/dist/graphiql-plugin-explorer.umd.js'; public const CSS_PATH_LOCAL = 'vendor/graphiql/graphiql.min.css'; public const CSS_PATH_CDN = '//unpkg.com/graphiql/graphiql.min.css'; @@ -38,7 +39,7 @@ public function handle(): void $this->downloadFileFromCDN(self::REACT_DOM_PATH_LOCAL, self::REACT_DOM_PATH_CDN); $this->downloadFileFromCDN(self::CSS_PATH_LOCAL, self::CSS_PATH_CDN); $this->downloadFileFromCDN(self::JS_PATH_LOCAL, self::JS_PATH_CDN); - $this->downloadFileFromCDN(self::EXPLORER_PLUGIN_PATH_LOCAL, self::EXPLORER_PLUGIN_PATH_CDN); + $this->downloadFileFromCDN(self::PLUGIN_EXPLORER_PATH_LOCAL, self::PLUGIN_EXPLORER_PATH_CDN); $this->downloadFileFromCDN(self::FAVICON_PATH_LOCAL, self::FAVICON_PATH_CDN); } @@ -76,9 +77,9 @@ public static function jsPath(): string return self::assetPath(self::JS_PATH_LOCAL, self::JS_PATH_CDN); } - public static function explorerPluginPath(): string + public static function pluginExplorerPath(): string { - return self::assetPath(self::EXPLORER_PLUGIN_PATH_LOCAL, self::EXPLORER_PLUGIN_PATH_CDN); + return self::assetPath(self::PLUGIN_EXPLORER_PATH_LOCAL, self::PLUGIN_EXPLORER_PATH_CDN); } public static function cssPath(): string diff --git a/views/index.blade.php b/views/index.blade.php index b924706..7e65cb1 100644 --- a/views/index.blade.php +++ b/views/index.blade.php @@ -1,6 +1,6 @@ - +@php use MLL\GraphiQL\DownloadAssetsCommand; @endphp - - - - + + + +
Loading...
- - + +