Skip to content

Add ability to register private blocks, sets and presets #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
May 6, 2025
Merged
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
f299043
Refactor files for first preset
robdekort Jan 23, 2025
a13e7cf
Ignore dependency locks and allow `pixelfear/composer-dist-plugin`
marcorieser Jan 23, 2025
1353368
Migrate first preset to new structure
robdekort Jan 23, 2025
b5677c2
Add basic config
marcorieser Jan 23, 2025
f29cebd
Add new presets
robdekort Jan 23, 2025
2a9ced6
Load presets from folder structure
marcorieser Jan 23, 2025
466f9d7
Format
marcorieser Jan 23, 2025
64c85ff
Refactor all presets
robdekort Jan 23, 2025
51d63c3
Refactor sets
robdekort Jan 23, 2025
674b5be
Add path to preset config
marcorieser Jan 23, 2025
5ec5c8a
Migrate blocks
robdekort Jan 23, 2025
86fd818
Merge branch 'feature/refactor-install-commands' of https://github.co…
robdekort Jan 23, 2025
cbfd957
Use instructions instead of description
robdekort Jan 23, 2025
0a3dde2
Remove trait references
marcorieser Jan 23, 2025
ac3c060
Update preset copy logic
marcorieser Jan 23, 2025
482a907
Some tweaks
marcorieser Jan 23, 2025
e10e6c9
Move name and description up
marcorieser Jan 23, 2025
ad70a2e
Load blocks from directories
marcorieser Jan 23, 2025
859f776
Load sets from directories
marcorieser Jan 23, 2025
6d5f863
Extract and refactor stuff
marcorieser Jan 23, 2025
006d906
Use same presets logic for blocks and sets
marcorieser Jan 23, 2025
a294cbf
Teach Marco how to write lean addons 🤪
robdekort Jan 24, 2025
123fab9
Remove function call
robdekort Jan 24, 2025
ea29794
Remove todo
robdekort Jan 24, 2025
f11c7f6
x-collapse banner
robdekort Jan 24, 2025
1d9123c
Fix business hours config
robdekort Jan 24, 2025
f068423
Fix team members collection.yaml location
robdekort Jan 24, 2025
099f231
Fix vacancies collection.yaml location
robdekort Jan 24, 2025
36bfc44
Create base structure for class based Installable / Operations logic
marcorieser Jan 26, 2025
b824f70
Add support for fully qualified namespaces
marcorieser Jan 28, 2025
7f75c1a
Add basic test case
marcorieser Jan 28, 2025
44a6faa
Require PHP ^8.2
marcorieser Jan 28, 2025
d9cb21e
Add Registry
marcorieser Jan 28, 2025
bb76e59
Check for no installables
marcorieser Jan 28, 2025
1a0a6f7
Move test class
marcorieser Jan 28, 2025
c3b131d
Add basic Registry test
marcorieser Jan 28, 2025
faab4a6
Fix clients preset title width
robdekort Jan 29, 2025
e411f1f
Remove comment from clients preset notification
robdekort Jan 29, 2025
e6e64d7
Make mount options more clear
robdekort Jan 29, 2025
74ad5ce
Update CHANGELOG
robdekort Jan 29, 2025
72d1edb
Streamline install commands
marcorieser Feb 4, 2025
496f3a8
Add notify and update_role operations
marcorieser Feb 4, 2025
cecf607
Add rename operation
marcorieser Feb 4, 2025
0ce0b1b
Improve FAQ semantics and a11y
robdekort Feb 4, 2025
6a6156a
Improve theme switcher a11y
robdekort Feb 4, 2025
1ff51e9
Update CHANGELOG
robdekort Feb 4, 2025
8164390
Add update_article_sets operation
marcorieser Feb 4, 2025
98b9729
Cleanup operations
marcorieser Feb 5, 2025
cbac92f
Mark operations trait for deletion
marcorieser Feb 5, 2025
23cd3f8
Add run command
marcorieser Feb 5, 2025
823cc5a
Do some refactoring for make:block command
marcorieser Feb 5, 2025
cc5d284
Migrate MakeSet command
robdekort Feb 6, 2025
f2f7eb5
Convert #31
robdekort Feb 6, 2025
4fb50b2
Update CHANGELOG
robdekort Feb 6, 2025
6f77783
Fix footer class
robdekort Feb 13, 2025
d00efab
Update CHANGELOG
robdekort Feb 13, 2025
ff8103c
Refactor make block command to model
marcorieser Feb 17, 2025
08b2c4a
Refactor make set command to model
marcorieser Feb 17, 2025
e8e7b16
Use set config key instead of block
marcorieser Feb 17, 2025
101deab
Fix tpyo
robdekort Mar 3, 2025
0e4fe65
Merge branch 'feature/refactor-install-commands' of https://github.co…
robdekort Mar 3, 2025
c5dc64a
Add ability to pass replacements to the copy operation
marcorieser Mar 9, 2025
b1a956f
Use `info()` from laravel prompts package
marcorieser Mar 9, 2025
e0d7a35
Move `NeedsValidLicense` trait to trait namespace
marcorieser Mar 9, 2025
fe5f5e9
Add todo
marcorieser Mar 9, 2025
0c38edd
Refactor make partial command
marcorieser Mar 9, 2025
d06de5e
WIP: Refactor make taxonomy command
marcorieser Mar 9, 2025
30c136b
Fix events preset
robdekort Mar 10, 2025
7c900b0
Merge branch 'feature/refactor-install-commands' of https://github.co…
robdekort Mar 10, 2025
368d1ab
Merge in PR #33
robdekort Mar 27, 2025
a4d75c0
Cleanup
marcorieser Mar 31, 2025
31afa3d
Fix update_role operation
marcorieser Mar 31, 2025
27cd927
Create attach_taxonomy_to_collections operation
marcorieser Mar 31, 2025
5ce174c
Restructure MakeBlock command
marcorieser Mar 31, 2025
14ae16f
Rewrite MakeTaxonomy command
marcorieser Mar 31, 2025
ac3f4f3
Fix prompt for defaults logic
marcorieser Mar 31, 2025
635289d
Committing in accordance with the prophecy.
marcorieser Mar 31, 2025
ce40934
Restructure MakePartial command
marcorieser Mar 31, 2025
0bb8214
Use trait for cache clearing
marcorieser Mar 31, 2025
2a3c27c
Restructure MakeSet command
marcorieser Mar 31, 2025
b5deb84
vibe coding mode enabled
marcorieser Mar 31, 2025
c9e3503
Restructure MakeNav command
marcorieser Mar 31, 2025
7442c89
Merge branch 'main' into feature/refactor-install-commands
marcorieser Mar 31, 2025
831dada
Add HandleWithCatch trait
marcorieser Mar 31, 2025
51dbf9a
Use HandleWithCatch
marcorieser Mar 31, 2025
f9cd40e
Remove SharedFunctions trait
marcorieser Mar 31, 2025
98595a0
Restructure MakeGlobal command
marcorieser Apr 1, 2025
1b09be4
Typ0
marcorieser Apr 1, 2025
dae8b63
Cleanup
marcorieser Apr 1, 2025
7206d91
Changes to the Readme
marcorieser Apr 1, 2025
4f153fb
Todos
marcorieser Apr 1, 2025
6e96973
Replace $this->info()
marcorieser Apr 1, 2025
60b5db7
Simplify object creation
marcorieser Apr 8, 2025
3feee33
Build collection model
marcorieser Apr 8, 2025
90eaf50
MakeCollection WIP
marcorieser Apr 8, 2025
f0707d7
Move stubs path part to different position
marcorieser May 1, 2025
30d28f6
Add formatting with laravel pint
marcorieser May 1, 2025
2d20f1a
Finalize make:collection command
marcorieser May 1, 2025
dec846a
Remove unnecessary traits
marcorieser May 1, 2025
7ade624
Correct stub path
marcorieser May 1, 2025
3f7c970
I don't know what these changes are supposed to accomplish, but someb…
marcorieser May 1, 2025
90cfb56
Remove nullable types from protected properties
marcorieser May 1, 2025
96b64f4
Refactoring the Registry
marcorieser May 2, 2025
a46e1fc
Refactor `path` to `basePath` in Installable configuration
marcorieser May 6, 2025
da7c196
Refactor file installation logic for clarity and efficiency
marcorieser May 6, 2025
1867fdb
Implement dynamic filepath handling for block generation
marcorieser May 6, 2025
66d6a4b
Update file path handling in MakeSet command and stubs
marcorieser May 6, 2025
c4734a6
Refactor ClearSite command for improved consistency and clarity.
marcorieser May 6, 2025
0d4dc3b
Add comments to config file
marcorieser May 6, 2025
2f701cc
Refactor operation resolution to RegistryManager
marcorieser May 6, 2025
e0c7da4
Do things better, faster, stronger
marcorieser May 6, 2025
1d1147f
Update CHANGELOG
robdekort May 6, 2025
9acde5b
Clear the cache after showing a message
marcorieser May 6, 2025
b1bc372
Merge remote-tracking branch 'origin/feature/refactor-install-command…
marcorieser May 6, 2025
0e38df0
Switch `info` to `note` in Laravel prompts.
marcorieser May 6, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
vendor
mix-manifest.json
composer.lock
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## v9.0.0 (2025-05-06)

### What's new
- The ability to load in your own private blocks, sets and presets to install. #28 by @marcorieser
- The ability to compose blocks, sets and presets with custom operations. #28 by @marcorieser
- A lot of code refactor. #28 by @marcorieser

Thank you Marco Rieser for your amazing work on this.

### What's improved
- Business hours preset supports overnight spans. #31 by @porstendorfer
- The prompts presented during the `make:collection` regarding mounting are more clear. e6e64d79 by @robdekort
- The banner presets now uses `x-collapse`. f11c7f67 by @robdekort
- Accessibility and semantics in the FAQ preset. 0ce0b1b4 by @robdekort
- FAQ sections to close smoothly. #33 by @podrabinek
- Accessibility in the theme toggle preset. 6a6156a9 by @robdekort

### What's fixed
- The width of the block title in the clients preset. faab4a6e by @robdekort
- A comment in the clients preset notification. e411f1f8 by @robdekort
- A class used in the footer preset is now compatible with Tailwind 4. 6f77783f by @robdekort
- A typo in the business hours preset. #32 by @porstendorfer

## v8.16.1 (2025-01-22)

### What's fixed
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -5,6 +5,11 @@
"Studio1902\\PeakCommands\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Studio1902\\PeakCommands\\Tests\\": "tests"
}
},
"extra": {
"statamic": {
"name": "Statamic Peak Commands",
@@ -17,6 +22,17 @@
}
},
"require": {
"php": "^8.2",
"statamic/cms": "^5.0"
},
"require-dev": {
"spatie/laravel-ray": "^1.39",
"orchestra/testbench": "^9.0",
"laravel/pint": "^1.22"
},
"config": {
"allow-plugins": {
"pixelfear/composer-dist-plugin": true
}
}
}
27 changes: 27 additions & 0 deletions config/statamic-peak-commands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

return [
/**
* Here you can configure the paths in which the commands addon
* searches for premade blocks, presets and article sets.
*/
'paths' => [
'blocks' => [
base_path('vendor/studio1902/statamic-peak-commands/resources/blocks'),
],
'presets' => [
base_path('vendor/studio1902/statamic-peak-commands/resources/presets'),
],
'sets' => [
base_path('vendor/studio1902/statamic-peak-commands/resources/sets'),
],
],

/**
* Here you can configure the namespaces in which the commands addon
* searches for available operations to run.
*/
'namespaces' => [
'\Studio1902\PeakCommands\Operations',
],
];
21 changes: 21 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" processIsolation="false" stopOnFailure="false" beStrictAboutTestsThatDoNotTestAnything="false">
<coverage/>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:ybcI9MKuhLnESRSuWDfnJQuohOXMBaynfbTC5Y5i1FE="/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>
28 changes: 28 additions & 0 deletions resources/blocks/call_to_action/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'call_to_action',
'name' => 'Call to action',
'description' => 'Show a call to action.',
'operations' => [
[
'type' => 'copy',
'input' => '_call_to_action.antlers.html',
'output' => 'resources/views/page_builder/_call_to_action.antlers.html',
],
[
'type' => 'copy',
'input' => 'call_to_action.yaml',
'output' => 'resources/fieldsets/call_to_action.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Call to action',
'instructions' => 'Show a call to action.',
'icon' => 'alert-alarm-bell',
'handle' => 'call_to_action',
],
],
],
];
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions resources/blocks/cards/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'cards',
'name' => 'Cards',
'description' => 'Cards that link using the button fieldset.',
'operations' => [
[
'type' => 'copy',
'input' => '_cards.antlers.html',
'output' => 'resources/views/page_builder/_cards.antlers.html',
],
[
'type' => 'copy',
'input' => 'cards.yaml',
'output' => 'resources/fieldsets/cards.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Cards',
'instructions' => 'Cards that link using the button fieldset.',
'icon' => 'link',
'handle' => 'cards',
],
],
],
];
File renamed without changes.
28 changes: 28 additions & 0 deletions resources/blocks/collection/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'collection',
'name' => 'Collection',
'description' => 'Show collection entries.',
'operations' => [
[
'type' => 'copy',
'input' => '_collection.antlers.html',
'output' => 'resources/views/page_builder/_collection.antlers.html',
],
[
'type' => 'copy',
'input' => 'collection.yaml',
'output' => 'resources/fieldsets/collection.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Collection',
'instructions' => 'Show collection entries.',
'icon' => 'file-content-list',
'handle' => 'collection',
],
],
],
];
File renamed without changes.
28 changes: 28 additions & 0 deletions resources/blocks/columns/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'columns',
'name' => 'Columns',
'description' => 'Text columns with optional images and buttons.',
'operations' => [
[
'type' => 'copy',
'input' => '_columns.antlers.html',
'output' => 'resources/views/page_builder/_columns.antlers.html',
],
[
'type' => 'copy',
'input' => 'columns.yaml',
'output' => 'resources/fieldsets/columns.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Columns',
'instructions' => 'Text columns with optional images and buttons.',
'icon' => 'layout-two-columns',
'handle' => 'columns',
],
],
],
];
28 changes: 28 additions & 0 deletions resources/blocks/divider/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'divider',
'name' => 'Divider',
'description' => 'A visual divider between blocks.',
'operations' => [
[
'type' => 'copy',
'input' => '_divider.antlers.html',
'output' => 'resources/views/page_builder/_divider.antlers.html',
],
[
'type' => 'copy',
'input' => 'divider.yaml',
'output' => 'resources/fieldsets/divider.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Divider',
'instructions' => 'A visual divider between blocks.',
'icon' => 'layout-table-row-insert',
'handle' => 'divider',
],
],
],
];
File renamed without changes.
28 changes: 28 additions & 0 deletions resources/blocks/full_width_image/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'full_width_image',
'name' => 'Full width image',
'description' => 'A full width image with optional text and button(s).',
'operations' => [
[
'type' => 'copy',
'input' => '_full_width_image.antlers.html',
'output' => 'resources/views/page_builder/_full_width_image.antlers.html',
],
[
'type' => 'copy',
'input' => 'full_width_image.yaml',
'output' => 'resources/fieldsets/full_width_image.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Full width image',
'instructions' => 'A full width image with optional text and button(s).',
'icon' => 'media-image-picture-orientation',
'handle' => 'full_width_image',
],
],
],
];
28 changes: 28 additions & 0 deletions resources/blocks/image_and_text/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'image_and_text',
'name' => 'Image and text',
'description' => 'An image and text side by side.',
'operations' => [
[
'type' => 'copy',
'input' => '_image_and_text.antlers.html',
'output' => 'resources/views/page_builder/_image_and_text.antlers.html',
],
[
'type' => 'copy',
'input' => 'image_and_text.yaml',
'output' => 'resources/fieldsets/image_and_text.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Image and text',
'instructions' => 'An image and text side by side.',
'icon' => 'text-formatting-image-left',
'handle' => 'image_and_text',
],
],
],
];
28 changes: 28 additions & 0 deletions resources/blocks/images_grid/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'images_grid',
'name' => 'Images grid',
'description' => 'A multi row image grid.',
'operations' => [
[
'type' => 'copy',
'input' => '_images_grid.antlers.html',
'output' => 'resources/views/page_builder/_images_grid.antlers.html',
],
[
'type' => 'copy',
'input' => 'images_grid.yaml',
'output' => 'resources/fieldsets/images_grid.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Images grid',
'instructions' => 'A multi row image grid.',
'icon' => 'layout-grid-dots',
'handle' => 'images_grid',
],
],
],
];
28 changes: 28 additions & 0 deletions resources/blocks/index_content/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

return [
'handle' => 'index_content',
'name' => 'Index content',
'description' => 'Render the currently mounted entries if available.',
'operations' => [
[
'type' => 'copy',
'input' => '_index_content.antlers.html',
'output' => 'resources/views/page_builder/_index_content.antlers.html',
],
[
'type' => 'copy',
'input' => 'index_content.yaml',
'output' => 'resources/fieldsets/index_content.yaml',
],
[
'type' => 'update_page_builder',
'block' => [
'name' => 'Index content',
'instructions' => 'Render the currently mounted entries if available.',
'icon' => 'file-content-list',
'handle' => 'index_content',
],
],
],
];
Loading