From 2f524f32716f378226fa851c199895cf465712b6 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Thu, 25 Jul 2024 09:14:58 +0530 Subject: [PATCH 1/2] feat: add themeisle-sdk to Blocks Animation The PR adds ThemeIsle SDK to Blocks Animation child-plugin. Closes https://github.com/Codeinwp/otter-internals/issues/196 --- bin/dist.sh | 5 ++ plugins/blocks-animation/blocks-animation.php | 15 +++++ plugins/blocks-animation/composer.json | 32 ++++++++++ plugins/blocks-animation/composer.lock | 62 +++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 plugins/blocks-animation/composer.json create mode 100644 plugins/blocks-animation/composer.lock diff --git a/bin/dist.sh b/bin/dist.sh index 9757ea4d1..d7e8c593d 100755 --- a/bin/dist.sh +++ b/bin/dist.sh @@ -86,6 +86,11 @@ do cd plugins/$BUILD_NAME + # We install dependencies only if composer.json exists. + if [ -f "composer.json" ]; then + composer install --no-dev + fi + rsync -rc --exclude-from ".distignore" "./" "../../dist/$DIST_FOLDER" cd ../.. diff --git a/plugins/blocks-animation/blocks-animation.php b/plugins/blocks-animation/blocks-animation.php index aa9404b3e..b402b1072 100644 --- a/plugins/blocks-animation/blocks-animation.php +++ b/plugins/blocks-animation/blocks-animation.php @@ -29,6 +29,21 @@ define( 'BLOCKS_ANIMATION_URL', plugins_url( '/', __FILE__ ) ); define( 'BLOCKS_ANIMATION_PATH', dirname( __FILE__ ) ); +$vendor_file = BLOCKS_ANIMATION_PATH . '/vendor/autoload.php'; + +if ( is_readable( $vendor_file ) ) { + require_once $vendor_file; +} + +add_filter( + 'themeisle_sdk_products', + function ( $products ) { + $products[] = __FILE__; + + return $products; + } +); + add_action( 'plugins_loaded', function () { diff --git a/plugins/blocks-animation/composer.json b/plugins/blocks-animation/composer.json new file mode 100644 index 000000000..24eebf3b9 --- /dev/null +++ b/plugins/blocks-animation/composer.json @@ -0,0 +1,32 @@ +{ + "name": "codeinwp/blocks-animation", + "description": "Blocks Animation: CSS Animations for Gutenberg Blocks", + "type": "wordpress-plugin", + "version": "2.6.13", + "license": "GPL-2.0+", + "authors": [ + { + "name": "ThemeIsle Team", + "email": "friends@themeisle.com" + } + ], + "prefer-stable": true, + "config": { + "optimize-autoloader": true, + "platform": { + "php": "7.4" + } + }, + "extra": { + "installer-disable": "true" + }, + "autoload": { + "files": [ + "vendor/codeinwp/themeisle-sdk/load.php" + ] + }, + "minimum-stability": "dev", + "require": { + "codeinwp/themeisle-sdk": "^3.2" + } +} diff --git a/plugins/blocks-animation/composer.lock b/plugins/blocks-animation/composer.lock new file mode 100644 index 000000000..c164af099 --- /dev/null +++ b/plugins/blocks-animation/composer.lock @@ -0,0 +1,62 @@ +{ + "_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": "ea8f98e8dd0f89202c94f9b316205943", + "packages": [ + { + "name": "codeinwp/themeisle-sdk", + "version": "3.3.25", + "source": { + "type": "git", + "url": "https://github.com/Codeinwp/themeisle-sdk.git", + "reference": "29b7c81f8ccd039f49d62ef7427a4cc06369becc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/29b7c81f8ccd039f49d62ef7427a4cc06369becc", + "reference": "29b7c81f8ccd039f49d62ef7427a4cc06369becc", + "shasum": "" + }, + "require-dev": { + "codeinwp/phpcs-ruleset": "dev-main" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "ThemeIsle team", + "email": "friends@themeisle.com", + "homepage": "https://themeisle.com" + } + ], + "description": "ThemeIsle SDK", + "homepage": "https://github.com/Codeinwp/themeisle-sdk", + "keywords": [ + "wordpress" + ], + "support": { + "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", + "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.25" + }, + "time": "2024-07-08T13:49:14+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "platform-overrides": { + "php": "7.4" + }, + "plugin-api-version": "2.6.0" +} From 97d32a5ab1c78fb4423009143bed5384e8e726a0 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Thu, 25 Jul 2024 09:21:07 +0530 Subject: [PATCH 2/2] chore: bump version check for blocks animation's composer.json --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8027fccc6..8eb5351e1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -50,7 +50,7 @@ module.exports = function( grunt ) { options: { flags: '' }, - src: [ 'package.json', 'composer.json', 'package-lock.json' ] + src: [ 'package.json', 'composer.json', 'package-lock.json', 'plugins/blocks-animation/composer.json' ] }, metatag: { options: {