Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Check code style (Pint)
run: vendor/bin/pint --test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
.DS_Store
vendor
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog

All notable changes to this starter kit will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Added

- GitHub Actions CI workflow that runs `composer validate` and Laravel Pint (style check) on every push/PR.
- `app/Providers/HorizonServiceProvider.php` now ships with the Thought Collective `viewHorizon` gate pre-configured (restricts non-local Horizon access to `@thoughtcollective.com` emails), so it no longer needs to be added by hand after every install.
- `description` and `license` fields to `composer.json` so `composer validate` passes cleanly.

### Changed

- `config/horizon.php` is no longer exported by the starter kit (`starter-kit.yaml`); Horizon's own defaults are used instead, avoiding a stale config file being copied into every new project.
- `resources/blueprints/collections/news/news.yaml`: bumped `earliest_date` to a more current date.
- `resources/blueprints/globals/social_media.yaml`: renamed the `Pinterest` replicator set key to `pinterest` for consistency with the other lowercase set keys.
- `app/Console/Commands/PanelUsage.php`: fixed a check that skipped pages with zero panels (`< 1` didn't correctly handle non-numeric/empty values); now uses `empty()`.
- `resources/js/components/maps.js`: fixed a marker `infoWindow` scoping bug where the info window instance wasn't available inside the click listener; fixed marker scale precedence.
- `app/Console/Commands/ScrapeGoogleUrls.php`: explicitly passed the `$escape` parameter to `fputcsv()` to avoid a PHP 8.4 deprecation warning.
- `README.md`: reworded the Slider Settings section to point to swiper.js's own API docs instead of an outdated description.
- `.gitignore`: trimmed down to just `.idea` and `.DS_Store`.

### Fixed

- `app/Listeners/GlobalListener.php`: geocoding lookups that fail (bad address, API key issue, etc.) no longer throw uncaught exceptions — they're now logged and surfaced to the editor as a Statamic CP toast notification instead.
- `app/Console/Commands/TestNotification.php`: added a `class_exists()` guard so passing a non-existent `--class` fails with a clear error instead of a fatal error.

### Removed

- `app/Console/Commands/ImportRedirects.php` and its references (superseded / unused).
- `app/Listeners/RecacheUrl.php` and its `UrlInvalidated` event mapping in `EventServiceProvider.php` (unused).
- Static Cache Manager references (`duncanmcclean/static-cache-manager`) from the README and the `access static-cache-manager utility` permission in `resources/users/roles.yaml` (package not used by this kit).
- Stale `image:` front-matter reference on `content/collections/pages/home.md` pointing at an asset that no longer applies.

[Unreleased]: https://github.com/thoughtco/statamic-starter-kit/compare/main...HEAD
10 changes: 5 additions & 5 deletions StarterKitPostInstall.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
use Illuminate\Support\Facades\Artisan;

use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;

class StarterKitPostInstall
{
Expand All @@ -16,13 +15,14 @@ public function handle($console)
$connectionType = $console->ask('What queue connection do you want?', 'redis');
$eyrisToken = $console->ask('Enter the token for Eyris?', null, function ($value) {
if (empty($value)) {
throw new \RuntimeException('Eyris token is required.');
throw new RuntimeException('Eyris token is required.');
}

return $value;
});

$env = app('files')->get(base_path('.env.thoughtco'));
$env = str_replace("APP_NAME=", "APP_NAME=\"{$appName}\"", $env);
$env = str_replace('APP_NAME=', "APP_NAME=\"{$appName}\"", $env);
$env = str_replace('APP_URL=', "APP_URL=\"{$appURL}\"", $env);
$env = str_replace('APP_KEY=', "APP_KEY=\"{$originalAppKey}\"", $env);
$env = str_replace('STATAMIC_REVISIONS_PATH=', "STATAMIC_REVISIONS_PATH=\"{$revisionPath}\"", $env);
Expand Down Expand Up @@ -57,7 +57,7 @@ public function handle($console)
$this->runProcess(['php', 'artisan', 'horizon:install'], $console, 'horizon assets published');

$this->runProcess(['composer', 'require', 'thoughtco/statamic-eyris'], $console, 'eyris installed');
$this->runProcess(['php', 'artisan', 'vendor:publish', '--tag=statamic-eyris'], $console, 'eyris assets published');
$this->runProcess(['php', 'artisan', 'vendor:publish', '--tag=statamic-eyris'], $console, 'eyris assets published');

$this->runProcess(['php', 'artisan', 'queue:restart'], $console, 'queues restarted');

Expand Down
2 changes: 1 addition & 1 deletion app/Caching/StaticWarmExtras.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ public function handle()
{
return collect();
}
}
}
21 changes: 11 additions & 10 deletions app/Console/Commands/PanelUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class PanelUsage extends Command
{
/**
/**
* The name and signature of the console command.
*
* @var string
Expand Down Expand Up @@ -38,18 +38,18 @@ public function __construct()
*/
public function handle()
{
//get all panels
// get all panels
$pages = Entry::query()
->where('collection', 'pages')
->where('published', true)
->get(['panels']);

$panels = [];

$checkMode = $this->option('panel') ? 'panel' : 'count';
$panelWeWant = $this->option('panel') ?? false;

foreach ($pages AS $page) {
foreach ($pages as $page) {

if (empty($page->panels)) {
continue;
Expand All @@ -69,32 +69,33 @@ public function handle()
$panels[] = ['title' => $page->title, 'url' => url($page->url())];
}

// we are counting panels
// we are counting panels
} else {

foreach ($page->panels as $panel) {
$type = $panel['type'];
if (!isset($panels[$type])) {

if (! isset($panels[$type])) {
$panels[$type] = ['type' => $type, 'count' => 0];
}

$panels[$type]['count']++;
}

}

}

if ($checkMode == 'count') {

$panels = collect($panels)->sortByDesc('count')->values();

$this->table(['Type', 'Count'], $panels);

return;
}

$panels = collect($panels)->sortBy('url')->values();
$this->table(['Title', 'URL'], $panels);
}
}
}
Loading
Loading