Skip to content

Commit

Permalink
Improve readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Jan 13, 2025
1 parent 0572897 commit 0ad1f2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,39 +209,39 @@ class MyController extends Controller

### DatastarEventStream Trait

#### mergeFragments()
#### `mergeFragments()`

Merges one or more fragments into the DOM.

```php
$this->mergeFragments('<div id="new-fragment">New fragment</div>');
```

#### removeFragments()
#### `removeFragments()`

Removes one or more HTML fragments that match the provided selector from the DOM.

```php
$this->removeFragments('#old-fragment');
```

#### mergeSignals()
#### `mergeSignals()`

Updates the signals with new values.

```php
$this->mergeSignals(['foo' => 1, 'bar' => 2]);
```

#### removeSignals()
#### `removeSignals()`

Removes signals that match one or more provided paths.

```php
$this->removeSignals(['foo', 'bar']);
```

#### executeScript()
#### `executeScript()`

Executes JavaScript in the browser.

Expand Down
18 changes: 6 additions & 12 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@
To run static analysis on the plugin, install [PHPStan for Craft CMS](https://github.com/craftcms/phpstan) and run the following command from the root of your project.

```shell
./vendor/bin/phpstan analyse -c vendor/putyourlightson/craft-datastar-module/phpstan.neon --memory-limit 1G
php vendor/bin/phpstan analyse -c vendor/putyourlightson/laravel-datastar/phpstan.neon --memory-limit 1G
```

## Easy Coding Standard

To run the Easy Coding Standard on the plugin, install [ECS for Craft CMS](https://github.com/craftcms/ecs) and run the following command from the root of your project.

```shell
./vendor/bin/ecs check -c vendor/putyourlightson/craft-datastar-module/ecs.php
php vendor/bin/ecs check -c vendor/putyourlightson/laravel-datastar/ecs.php
```

## Pest Tests

To run Pest tests, first install [Craft Pest](https://craft-pest.com/) core as a dev dependency.
To run Pest tests, first install [Pest PHP](https://pestphp.com/) as a dev dependency.

```shell
composer require markhuot/craft-pest-core:^2.0.0 --dev
composer require pestphp/pest:^3.0.0 --dev
```

Then run the following command from the root of your project.

```shell
php php vendor/bin/pest --configuration=vendor/putyourlightson/craft-datastar-module/phpunit.xml --test-directory=vendor/putyourlightson/craft-datastar-module/tests
```

Or to run a specific test.

```shell
php php vendor/bin/pest --configuration=vendor/putyourlightson/craft-datastar-module/phpunit.xml --test-directory=vendor/putyourlightson/craft-datastar-module/tests --filter=StoreTest
```
php vendor/bin/pest vendor/putyourlightson/laravel-datastar/tests --test-directory=vendor/putyourlightson/laravel-datastar/tests --colors --display-deprecations
```ightson/laravel-datastar/tests --colors --display-deprecations

0 comments on commit 0ad1f2c

Please sign in to comment.