Skip to content

Commit

Permalink
Extract functionality into Spark Plug module
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Nov 1, 2024
1 parent 5210e31 commit e066bd6
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 3,344 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Changed

- The Spark plugin is now powered by the [Spark Plug](https://github.com/putyourlightson/craft-spark-plug) module.
- Events are now streamed to the browser as they are parsed, rather than all at once at the end of the request.

## 1.0.0-alpha.2 - 2024-10-30
Expand Down
41 changes: 4 additions & 37 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,7 @@
Copyright © putyourlightson
Copyright © PutYourLightsOn

Permission is hereby granted to any person obtaining a copy of this software
(the “Software”) to use, copy, modify, merge, publish and/or distribute copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

1. **Don’t plagiarize.** The above copyright notice and this license shall be
included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

2. **Don’t use the same license on more than one project.** Each licensed copy
of the Software shall be actively installed in no more than one production
environment at a time.

3. **Don’t mess with the licensing features.** Software features related to
licensing shall not be altered or circumvented in any way, including (but
not limited to) license validation, payment prompts, feature restrictions,
and update eligibility.

4. **Pay up.** Payment shall be made immediately upon receipt of any notice,
prompt, reminder, or other message indicating that a payment is owed.

5. **Follow the law.** All use of the Software shall not violate any applicable
law or regulation, nor infringe the rights of any other person or entity.

Failure to comply with the foregoing conditions will automatically and
immediately result in termination of the permission granted hereby. This
license does not include any right to receive updates to the Software or
technical support. Licensees bear all risk related to the quality and
performance of the Software and any modifications made or obtained to it,
including liability for actual and consequential harm, such as loss or
corruption of data, and any necessary service, repair, or correction.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
LIABILITY, INCLUDING SPECIAL, INCIDENTAL AND CONSEQUENTIAL DAMAGES, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"require": {
"php": ">=8.2",
"craftcms/cms": "^5.0",
"putyourlightson/datastar-php": "1.0.1"
"putyourlightson/datastar-php": "1.0.1",
"putyourlightson/craft-spark-plug": "^1.0.0-alpha.1"
},
"require-dev": {
"craftcms/ecs": "dev-main",
Expand All @@ -16,7 +17,7 @@
},
"autoload": {
"psr-4": {
"putyourlightson\\spark\\": "src/"
"putyourlightson\\spark\\plugin\\": "src/"
}
},
"extra": {
Expand All @@ -26,21 +27,20 @@
"developerUrl": "https://putyourlightson.com/",
"documentationUrl": "https://putyourlightson.com/plugins/spark",
"changelogUrl": "https://raw.githubusercontent.com/putyourlightson/craft-spark/develop/CHANGELOG.md",
"class": "putyourlightson\\spark\\Spark"
"class": "putyourlightson\\spark\\plugin\\Plugin"
},
"scripts": {
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --ansi --fix",
"phpstan": "phpstan --memory-limit=1G"
},
"config": {
"sort-packages": true,
"platform": {
"php": "8.2"
},
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
}
"craftcms/plugin-installer": true,
"pestphp/pest-plugin": true,
"yiisoft/yii2-composer": true
},
"optimize-autoloader": true,
"sort-packages": true
}
}
24 changes: 24 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* @copyright Copyright (c) PutYourLightsOn
*/

namespace putyourlightson\spark\plugin;

use craft\base\Plugin as BasePlugin;
use putyourlightson\spark\Spark;

class Plugin extends BasePlugin
{
/**
* @inerhitdoc
*/
public string $schemaVersion = '0.0.1';

public function init(): void
{
parent::init();

Spark::bootstrap();
}
}
98 changes: 0 additions & 98 deletions src/Spark.php

This file was deleted.

29 changes: 0 additions & 29 deletions src/assets/DatastarAssetBundle.php

This file was deleted.

66 changes: 0 additions & 66 deletions src/controllers/ResponseController.php

This file was deleted.

77 changes: 0 additions & 77 deletions src/models/ConfigModel.php

This file was deleted.

Loading

0 comments on commit e066bd6

Please sign in to comment.