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

Workbench Integration #286

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Workbench Integration #286

merged 1 commit into from
Aug 31, 2023

Conversation

crynobone
Copy link
Contributor

This PR introduces Workbench Integration where you can preview a demo Nova application directly inside your package using composer run serve.

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
- NovaKit\NovaPackagesTool\LaravelServiceProvider
- Spatie\LaravelRay\RayServiceProvider
- Oneduo\NovaFileManager\ToolServiceProvider
- Workbench\App\Providers\NovaServiceProvider
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post-autoload-dump already runs testbench package:discover so manually adding the above service provider isn't no longer required.

@mikaelpopowicz
Copy link
Collaborator

Hi @crynobone

Thank you! 🚀

@mikaelpopowicz mikaelpopowicz merged commit 92454c2 into oneduo:main Aug 31, 2023
3 of 11 checks passed
@crynobone crynobone deleted the workbench branch August 31, 2023 10:18
@mikaelpopowicz
Copy link
Collaborator

Hi @crynobone

I just noticed that the serve composer script timeout after 300 seconds, which is the composer's default process timeout.

The Orchestra\Testbench\Foundation\Console\ServeCommand may disable the process timeout if composer/composer is installed.

if (
    class_exists(ComposerConfig::class, false)
    && method_exists(ComposerConfig::class, 'disableProcessTimeout') // @phpstan-ignore-line
) {
    ComposerConfig::disableProcessTimeout();
}

We may disable the process timeout directly in the scripts section as described in the composer config documentation

{
  "scripts": {
    "post-autoload-dump": [
      "@prepare",
      "@dusk:install-chromedriver"
    ],
    "clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
    "prepare": "@php vendor/bin/testbench package:discover --ansi",
    "dusk:install-chromedriver": "@php vendor/bin/dusk-updater detect --auto-update --ansi",
    "build": "@php vendor/bin/testbench workbench:build --ansi",
    "serve": [
+    "Composer\\Config::disableProcessTimeout",
      "@build",
      "@php vendor/bin/testbench serve"
    ]
}

@crynobone
Copy link
Contributor Author

crynobone commented Aug 31, 2023

https://github.com/orchestral/testbench-core/blob/8.x/src/Foundation/Console/ServeCommand.php#L23-L28

make sure you running on the latest version which has this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants