From 6fd937b6a5deadeea2f6f421cba441f8a4ca071e Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Mon, 1 Feb 2021 11:54:30 +0100 Subject: [PATCH 01/12] Create composer.json --- composer.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5c8e4a8 --- /dev/null +++ b/composer.json @@ -0,0 +1,25 @@ +{ + "name": "deworg/dewp-planet-feed", + "description": "WordPress Plugin: DEWP Planet Feed", + "type": "wordpress-plugin", + "repositories": [ + { + "type": "composer", + "url": "https://wpackagist.org" + } + ], + "authors": [ + { + "name": "Florian Brinkmann", + }, + { + "name": "Caspar Hübinger", + }, + { + "name": "Dominik Schilling", + } + ], + "require": { + "composer/installers": "^1.0" + } +} From 46fdbee8bd1ab1d9b5309de23fd5320b2096afca Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Mon, 1 Feb 2021 17:01:58 +0100 Subject: [PATCH 02/12] Update composer.json --- composer.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/composer.json b/composer.json index 5c8e4a8..a69caac 100644 --- a/composer.json +++ b/composer.json @@ -2,12 +2,6 @@ "name": "deworg/dewp-planet-feed", "description": "WordPress Plugin: DEWP Planet Feed", "type": "wordpress-plugin", - "repositories": [ - { - "type": "composer", - "url": "https://wpackagist.org" - } - ], "authors": [ { "name": "Florian Brinkmann", From 301a99cb66c8f7c530fa94db1f8b9db4ae750f36 Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 13:09:40 +0100 Subject: [PATCH 03/12] Add & fix Authors --- composer.json | 9 ++++++--- package.json | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index a69caac..cdb71c3 100644 --- a/composer.json +++ b/composer.json @@ -4,13 +4,16 @@ "type": "wordpress-plugin", "authors": [ { - "name": "Florian Brinkmann", + "name": "Florian Brinkmann" }, { - "name": "Caspar Hübinger", + "name": "Caspar Hübinger" }, { - "name": "Dominik Schilling", + "name": "Dominik Schilling" + }, + { + "name": "Torsten Landsiedel" } ], "require": { diff --git a/package.json b/package.json index 890bcd2..01e3ecc 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "git+https://github.com/deworg/dewp-planet-feed.git" }, - "author": "Florian Brinkmann, Caspar Hübinger, Dominik Schilling", + "author": "Florian Brinkmann, Caspar Hübinger, Dominik Schilling, Torsten Landsiedel", "license": "GPL-3.0-or-later", "bugs": { "url": "https://github.com/deworg/dewp-planet-feed/issues" From a1f131f9454ca6653f748418c091a04daa44636c Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 13:10:46 +0100 Subject: [PATCH 04/12] Add Composer Plugin Assets Compiler and setup download pre compiled from Github Release --- .gitignore | 1 + assets-compiler.json | 18 ++++ composer.json | 9 +- composer.lock | 224 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 assets-compiler.json create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 71f5204..52b647a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_STORE *.bak node_modules/ +vendor assets/js/functions.js \ No newline at end of file diff --git a/assets-compiler.json b/assets-compiler.json new file mode 100644 index 0000000..8015a3f --- /dev/null +++ b/assets-compiler.json @@ -0,0 +1,18 @@ +{ + "script": "build:production", + "pre-compiled": { + "env": { + "root": { + "adapter": false + }, + "$default": { + "source": "assets", + "target": "./assets/", + "adapter": "gh-release-zip", + "config": { + "repository": "goaround/dewp-planet-feed" + } + } + } + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index cdb71c3..e9b8167 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,13 @@ } ], "require": { - "composer/installers": "^1.0" + "composer/installers": "^1.0", + "inpsyde/composer-assets-compiler": "^2.0" + }, + "extra": { + "composer-asset-compiler": { + "dependencies": "install", + "script": "build:production" + } } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..c42717c --- /dev/null +++ b/composer.lock @@ -0,0 +1,224 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "f2503ce0f2b65d466dad41d13ae924fb", + "packages": [ + { + "name": "composer/installers", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d", + "reference": "1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.3" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "modulework", + "modx", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v1.10.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-01-14T11:07:16+00:00" + }, + { + "name": "inpsyde/composer-assets-compiler", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/inpsyde/composer-asset-compiler.git", + "reference": "11de914f4a003f74d7d522f12947356c893f460e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/inpsyde/composer-asset-compiler/zipball/11de914f4a003f74d7d522f12947356c893f460e", + "reference": "11de914f4a003f74d7d522f12947356c893f460e", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1 || ^2", + "ext-json": "*", + "php": ">= 7.2" + }, + "require-dev": { + "composer/composer": "^2", + "inpsyde/php-coding-standards": "^1@dev", + "mikey179/vfsstream": "^1.6", + "mockery/mockery": "^1", + "phpunit/phpunit": "^8", + "vimeo/psalm": "^3" + }, + "type": "composer-plugin", + "extra": { + "class": "Inpsyde\\AssetsCompiler\\Composer\\Plugin" + }, + "autoload": { + "psr-4": { + "Inpsyde\\AssetsCompiler\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Inpsyde GmbH", + "role": "company" + }, + { + "name": "Giuseppe Mazzapica", + "email": "g.mazzapica@inpsyde.com" + } + ], + "description": "Composer plugin that installs and compile frontend dependencies for installed Composer packages based on configuration.", + "support": { + "issues": "https://github.com/inpsyde/composer-asset-compiler/issues", + "source": "https://github.com/inpsyde/composer-asset-compiler/tree/2.0.1" + }, + "time": "2020-12-02T17:52:14+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.0.0" +} From 2a96e38e366c8b2ce346e3e301223752b1fb00ea Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 13:11:08 +0100 Subject: [PATCH 05/12] Setup Workflow to add assets.zip to release --- .github/workflows/deploy-workflow.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/deploy-workflow.yml b/.github/workflows/deploy-workflow.yml index 8160196..25c49e7 100644 --- a/.github/workflows/deploy-workflow.yml +++ b/.github/workflows/deploy-workflow.yml @@ -29,6 +29,7 @@ jobs: mkdir -p dewp-planet-feed rsync -rav --exclude-from='.rsync-exclude' --delete-excluded ./ dewp-planet-feed zip -r dewp-planet-feed.zip dewp-planet-feed/ + zip -r assets.zip dewp-planet-feed/assets/ rm -rf dewp-planet-feed - name: Get Release id: get_release @@ -40,3 +41,10 @@ jobs: asset_path: ./dewp-planet-feed.zip asset_name: dewp-planet-feed.zip asset_content_type: application/zip + - name: Upload assets ZIP to release. + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./assets.zip + asset_name: assets.zip + asset_content_type: application/zip From 6e9871f933858030e4f182e134cc660875329ff2 Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 13:15:31 +0100 Subject: [PATCH 06/12] Only zip assets --- .github/workflows/deploy-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-workflow.yml b/.github/workflows/deploy-workflow.yml index 25c49e7..af5ef60 100644 --- a/.github/workflows/deploy-workflow.yml +++ b/.github/workflows/deploy-workflow.yml @@ -29,7 +29,7 @@ jobs: mkdir -p dewp-planet-feed rsync -rav --exclude-from='.rsync-exclude' --delete-excluded ./ dewp-planet-feed zip -r dewp-planet-feed.zip dewp-planet-feed/ - zip -r assets.zip dewp-planet-feed/assets/ + zip -jr assets.zip dewp-planet-feed/assets/* rm -rf dewp-planet-feed - name: Get Release id: get_release From 5a1e35ee3913af97e325badf726cb8c6164ed346 Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 13:17:21 +0100 Subject: [PATCH 07/12] Only zip assets folder --- .github/workflows/deploy-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-workflow.yml b/.github/workflows/deploy-workflow.yml index af5ef60..7a7bfe3 100644 --- a/.github/workflows/deploy-workflow.yml +++ b/.github/workflows/deploy-workflow.yml @@ -29,7 +29,7 @@ jobs: mkdir -p dewp-planet-feed rsync -rav --exclude-from='.rsync-exclude' --delete-excluded ./ dewp-planet-feed zip -r dewp-planet-feed.zip dewp-planet-feed/ - zip -jr assets.zip dewp-planet-feed/assets/* + zip -r assets.zip dewp-planet-feed/assets/* rm -rf dewp-planet-feed - name: Get Release id: get_release From 1d21dd3c693cd34f3b7e4b58579c74f5916637ab Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 13:22:54 +0100 Subject: [PATCH 08/12] Try this --- .github/workflows/deploy-workflow.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-workflow.yml b/.github/workflows/deploy-workflow.yml index 7a7bfe3..55cbed8 100644 --- a/.github/workflows/deploy-workflow.yml +++ b/.github/workflows/deploy-workflow.yml @@ -29,7 +29,9 @@ jobs: mkdir -p dewp-planet-feed rsync -rav --exclude-from='.rsync-exclude' --delete-excluded ./ dewp-planet-feed zip -r dewp-planet-feed.zip dewp-planet-feed/ - zip -r assets.zip dewp-planet-feed/assets/* + cd dewp-planet-feed/assets + zip -r ../../assets.zip ./* + cd ../.. rm -rf dewp-planet-feed - name: Get Release id: get_release From a986cb9239306e8aeecddc8f1d722b72ed622bac Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 13:33:57 +0100 Subject: [PATCH 09/12] Change repository --- assets-compiler.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets-compiler.json b/assets-compiler.json index 8015a3f..df6a1ad 100644 --- a/assets-compiler.json +++ b/assets-compiler.json @@ -10,7 +10,7 @@ "target": "./assets/", "adapter": "gh-release-zip", "config": { - "repository": "goaround/dewp-planet-feed" + "repository": "deworg/dewp-planet-feed" } } } From 812964c2b8baaf196df8e7e41c4bc8fd6aa7ef24 Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Thu, 4 Feb 2021 14:03:52 +0100 Subject: [PATCH 10/12] Add Installation Readme --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22093aa..b134665 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,52 @@ * License: GPLv3 * License URI: http://www.gnu.org/licenses/gpl-3.0.html -## Description ## +## Description Generates a custom feed `dewp-planet` for posts. Adds a checkbox to the _Publish_ meta box in order to explicitly add a post to that custom feed. ![Screenshot (GIF)](https://github.com/deworg/dewp-planet-feed/blob/master/screenshot.gif?raw=true) --- +## Installation +1. Download the asset `dewp-planet-feed.zip` from the [latest release](https://github.com/deworg/dewp-planet-feed/releases/latest). +1. Upload the folder `dewp-planet-feed` to the `/wp-content/plugins/` directory +1. Activate the plugin through the 'Plugins' menu in WordPress + +### With Composer +If you would like to pull the plugin with Composer (e.g. with [Bedrock](https://roots.io/bedrock/)) you have to compile the JavaScript assets yourself or use the [Composer Asset Compiler](https://github.com/inpsyde/composer-asset-compiler). This plugin is compatible and even provides the pre-compiled assets for each release. + +To pull this Plugin with Composer, follow these steps: + +1. Add `git@github.com:deworg/dewp-planet-feed.git` as an addional Github repository to your `composer.json`: +```json + "repositories": [ + { + "type": "github", + "url": "git@github.com:deworg/dewp-planet-feed.git" + } + ], +``` +2. Require the plugin +```bash +$ composer require deworg/dewp-planet-feed +``` +3. Compile the assets with `npm run build:production` yourself or setup the [Composer Asset Compiler](https://github.com/inpsyde/composer-asset-compiler) +```bash +$ composer require inpsyde/composer-assets-compiler +``` +4. If you choose the Composer Asset Compiler, run `composer compile-assets` each time or activate auto run in your `composer.json`: +```json + "extra": { + "composer-asset-compiler": { + "auto-run": true, + } + } +``` +5. Done. If you choose auto run, try it with `composer update` or `composer install` + +--- + ## Changelog ### 0.5.1 – 28.10.2018 From 90a9105bf85c3624e8b99294e041655134f8a2e0 Mon Sep 17 00:00:00 2001 From: Florian Brinkmann Date: Fri, 5 Feb 2021 08:32:27 +0100 Subject: [PATCH 11/12] Use spaces for indentation in JSON --- assets-compiler.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets-compiler.json b/assets-compiler.json index df6a1ad..a9c743b 100644 --- a/assets-compiler.json +++ b/assets-compiler.json @@ -8,11 +8,11 @@ "$default": { "source": "assets", "target": "./assets/", - "adapter": "gh-release-zip", - "config": { - "repository": "deworg/dewp-planet-feed" - } + "adapter": "gh-release-zip", + "config": { + "repository": "deworg/dewp-planet-feed" + } } } } -} \ No newline at end of file +} From aae2407e3debbde090c05114da802da82b7453af Mon Sep 17 00:00:00 2001 From: Florian Brinkmann Date: Fri, 5 Feb 2021 08:51:16 +0100 Subject: [PATCH 12/12] Small readme changes --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b134665..81bf433 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,10 @@ Generates a custom feed `dewp-planet` for posts. Adds a checkbox to the _Publish --- ## Installation +### Via SFTP or backend 1. Download the asset `dewp-planet-feed.zip` from the [latest release](https://github.com/deworg/dewp-planet-feed/releases/latest). -1. Upload the folder `dewp-planet-feed` to the `/wp-content/plugins/` directory -1. Activate the plugin through the 'Plugins' menu in WordPress +1. Upload the folder `dewp-planet-feed` to the `/wp-content/plugins/` directory, or directly upload the ZIP through the »Plugins« › »Add new« › »Upload plugin« screen in the WordPress backend. +1. Activate the plugin through the »Plugins« menu in WordPress. ### With Composer If you would like to pull the plugin with Composer (e.g. with [Bedrock](https://roots.io/bedrock/)) you have to compile the JavaScript assets yourself or use the [Composer Asset Compiler](https://github.com/inpsyde/composer-asset-compiler). This plugin is compatible and even provides the pre-compiled assets for each release. @@ -24,27 +25,27 @@ To pull this Plugin with Composer, follow these steps: 1. Add `git@github.com:deworg/dewp-planet-feed.git` as an addional Github repository to your `composer.json`: ```json - "repositories": [ + "repositories": [ { - "type": "github", - "url": "git@github.com:deworg/dewp-planet-feed.git" - } - ], + "type": "github", + "url": "git@github.com:deworg/dewp-planet-feed.git" + } + ], ``` 2. Require the plugin ```bash $ composer require deworg/dewp-planet-feed ``` -3. Compile the assets with `npm run build:production` yourself or setup the [Composer Asset Compiler](https://github.com/inpsyde/composer-asset-compiler) +3. Compile the assets with `npm install && npm run build:production` in the plugin directory or setup the [Composer Asset Compiler](https://github.com/inpsyde/composer-asset-compiler) with: ```bash $ composer require inpsyde/composer-assets-compiler ``` -4. If you choose the Composer Asset Compiler, run `composer compile-assets` each time or activate auto run in your `composer.json`: +4. If you choose the Composer Asset Compiler, run `composer compile-assets` after every plugin update time or activate auto run in your `composer.json`: ```json - "extra": { + "extra": { "composer-asset-compiler": { - "auto-run": true, - } + "auto-run": true, + } } ``` 5. Done. If you choose auto run, try it with `composer update` or `composer install`