Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes NativePHP/laravel#493
This pull request introduces a new trait to manage asset building in the
BuildCommand
class, alongside several related changes to support this functionality. The most important changes include adding theManagesAssetBuilding
trait, updating theBuildCommand
class to use this trait, and implementing methods to detect and run NPM scripts.Enhancements to Build Command:
src/Commands/BuildCommand.php
: Added theManagesAssetBuilding
trait and updated the command signature to include options for building assets. To build assets, you can supply the--assets
option. It will default to runningnpm run build
. Ifbuild
is not the correct script name, it can be overridden like so:--asset-build=my-script
src/Commands/BuildCommand.php
: Modified thehandle
method to check and build project assets if the--assets
option is provided.New Trait for Asset Management:
src/Traits/ManagesAssetBuilding.php
: Introduced a new traitManagesAssetBuilding
that includes methods to detect NPM scripts, prompt for a build command, and run the selected NPM script.