AssetCompile

abstract class System\Console\Asset\AssetCompile
extends Winter\Storm\Console\Command
implements 
    Symfony\Component\Console\Command\SignalableCommandInterface

Extends

Class Description
Command

Command base class Contains utilities to make developing CLI commands nicer

Traits

Trait Description
HandlesCleanup

Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class.

ProvidesAutocompletion

Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class.

Properties

protected $configFile : string

Name of config file i.e. mix.webpack.js, vite.config.js

protected $description : string

The console command description.

protected $packageJson : System\Classes\Asset\PackageJson

PackageJson object holding the contents of the active package.json

protected $watchingFilePath : string

File path being watched, used for cleanup by mix:watch

inherited protected $laravel : Winter\Storm\Foundation\Application

Inherited from Command

inherited protected $replaces : array

Inherited from Command

List of commands that this command replaces (aliases)

Methods

public compileHandle (string $type) : integer

Parameters
Property Description
$type
string
Returns
integer

public watchHandle (string $type) : integer

Parameters
Property Description
$type
string
Returns
integer

protected afterExecution (string $configPath) : void

Ran after dispatching the compile process, use for tearing down

Parameters
Property Description
$configPath
string
Returns
void

protected beforeExecution (string $configPath) : void

Ran before dispatching the compile process, use for setting up

Parameters
Property Description
$configPath
string
Returns
void

protected createCommand (string $configPath) : array

Create the command array to create a Process object with

Parameters
Property Description
$configPath
string
Returns
array

protected executeProcess (string $configPath) : integer

Run the mix command against the provided package

Parameters
Property Description
$configPath
string
Returns
integer

protected getJsConfigPath (string $path) : string

Get the path to the mix.webpack.js file for the provided winter.mix.js file

Parameters
Property Description
$path
string
Returns
string

protected getNpmPackageManifest () : System\Classes\Asset\PackageJson

Read the package.json file for the project, path configurable with the --manifest option

Returns
System\Classes\Asset\PackageJson

protected getPackagePath (string $path) : string

Get the package path for the provided winter.mix.js file

Parameters
Property Description
$path
string
Returns
string

protected isPackageWithinWorkspace (string $mixJsPath) : bool

Check if Mix is able to compile the provided winter.mix.js file

Parameters
Property Description
$mixJsPath
string
Returns
bool

inherited public __construct ()

Inherited from Command

Create a new command instance.

Returns
mixed

inherited public alert (string $string, int | string | null $verbosity = null) : void

Inherited from Command

Write a string in an alert box.

Parameters
Property Description
$string
string
$verbosity
int | string | null
Returns
void

inherited public complete (Symfony\Component\Console\Completion\CompletionInput $input, Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void

Provide autocompletion for this command's input

Parameters
Property Description
$input
Symfony\Component\Console\Completion\CompletionInput
$suggestions
Symfony\Component\Console\Completion\CompletionSuggestions
Returns
void

inherited public error (string $string, int | string | null $verbosity = null) : void

Inherited from Command

Write a string as error output.

Parameters
Property Description
$string
string
$verbosity
int | string | null
Returns
void

inherited public getSubscribedSignals () : array

Inherited from HandlesCleanup

Returns the process signals this command listens to

Returns
array

inherited public handleSignal (integer $signal) : void

Inherited from HandlesCleanup

Handle the provided Unix process signal

Parameters
Property Description
$signal
integer
Returns
void

inherited public handleWindowsSignal (integer $event) : void

Inherited from HandlesCleanup

Handle the provided Windows process singal.

Parameters
Property Description
$event
integer
Returns
void

Extended by

Class Description
MixCompile
ViteCompile
Copyright © 2024 Winter CMS