Skip to content

Commit

Permalink
Merge pull request #277 from hydephp/remove-scriptpath-from-asset-ser…
Browse files Browse the repository at this point in the history
…vice

Remove AssetService::scriptPath helper as Hyde.js no longer exists
  • Loading branch information
caendesilva authored Jul 26, 2022
2 parents 6107a75 + 0afa6db commit a6bdea5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
7 changes: 2 additions & 5 deletions packages/framework/src/Contracts/AssetServiceContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ public function version(): string;

/**
* Return the main Hyde stylesheet location/path.
*
* @deprecated v0.50.x - Use cdnLink() instead.
*/
public function stylePath(): string;

/**
* Return the main Hyde script location/path.
*/
public function scriptPath(): string;

/**
* Construct a URI path for the CDN using the static dist version.
*/
Expand Down
1 change: 0 additions & 1 deletion packages/framework/src/Facades/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*
* @method static string version()
* @method static string stylePath()
* @method static string scriptPath()
* @method static string constructCdnPath(string $file)
* @method static string cdnLink(string $file)
* @method static bool hasMediaFile(string $file)
Expand Down
8 changes: 3 additions & 5 deletions packages/framework/src/Services/AssetService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ public function version(): string
return $this->version;
}

/**
* @deprecated v0.50.x - Use cdnLink() instead.
*/
public function stylePath(): string
{
return $this->constructCdnPath('hyde.css');
}

public function scriptPath(): string
{
return $this->constructCdnPath('hyde.js');
}

public function constructCdnPath(string $file): string
{
return 'https://cdn.jsdelivr.net/npm/hydefront@'.$this->version().'/dist/'.$file;
Expand Down
7 changes: 0 additions & 7 deletions packages/framework/tests/Feature/AssetServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ public function test_style_path_method_returns_cdn_path()
$this->assertStringContainsString('hyde.css', $service->stylePath());
}

public function test_script_path_method_returns_cdn_path()
{
$service = new AssetService();
$this->assertIsString($service->scriptPath());
$this->assertStringContainsString('hyde.js', $service->scriptPath());
}

public function test_cdn_path_constructor_returns_cdn_uri()
{
$service = new AssetService();
Expand Down

0 comments on commit a6bdea5

Please sign in to comment.