Add assets compiler

This commit is contained in:
Alex P 2023-08-25 15:09:16 +03:00
parent 84bdea35e2
commit a2e547c8cd
No known key found for this signature in database
GPG key ID: 54487A734A204D71
15 changed files with 192 additions and 57 deletions

View file

@ -14,6 +14,7 @@ psalm*.xml*
phpunit.xml* phpunit.xml*
.phpunit.result.cache .phpunit.result.cache
resources resources
node_modules
*.lock *.lock
webpack.config.js webpack.config.js
wp-cli.yml wp-cli.yml
@ -21,6 +22,8 @@ ngrok.yml
composer.json composer.json
package.json package.json
package-lock.json package-lock.json
.composer_compiled_assets
assets-compiler.json
patchwork.json patchwork.json
.babelrc .babelrc
README.md README.md

1
.gitignore vendored
View file

@ -13,3 +13,4 @@ modules/ppcp-wc-gateway/assets/css
auth.json auth.json
.DS_Store .DS_Store
tests/.DS_Store tests/.DS_Store
.composer_compiled_assets

4
assets-compiler.json Normal file
View file

@ -0,0 +1,4 @@
{
"dependencies": "install",
"commands": "yarn"
}

View file

@ -14,6 +14,7 @@
"symfony/polyfill-php80": "^1.19" "symfony/polyfill-php80": "^1.19"
}, },
"require-dev": { "require-dev": {
"inpsyde/composer-assets-compiler": "^2.5",
"psr/container": "^1.0", "psr/container": "^1.0",
"dhii/module-interface": "^0.2 || ^0.3", "dhii/module-interface": "^0.2 || ^0.3",
"container-interop/service-provider": "^0.4.0", "container-interop/service-provider": "^0.4.0",
@ -68,6 +69,15 @@
"vendor/bin/phpcbf" "vendor/bin/phpcbf"
] ]
}, },
"composer-asset-compiler": {
"auto-discover": true,
"packages": {
"inpsyde/*": {
"dependencies": "install",
"script": "build"
}
}
},
"mozart": { "mozart": {
"dep_namespace": "WooCommerce\\PayPalCommerce\\Vendor\\", "dep_namespace": "WooCommerce\\PayPalCommerce\\Vendor\\",
"dep_directory": "/lib/packages/", "dep_directory": "/lib/packages/",
@ -83,6 +93,7 @@
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {
"inpsyde/composer-assets-compiler": true,
"dealerdirect/phpcodesniffer-composer-installer": true, "dealerdirect/phpcodesniffer-composer-installer": true,
"wikimedia/composer-merge-plugin": true "wikimedia/composer-merge-plugin": true
} }

180
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "97559eb2b9d8b6f1529d44abd2604f99", "content-hash": "282f8541c4ce8de1e5c061e197e395fa",
"packages": [ "packages": [
{ {
"name": "container-interop/service-provider", "name": "container-interop/service-provider",
@ -521,16 +521,16 @@
}, },
{ {
"name": "wikimedia/composer-merge-plugin", "name": "wikimedia/composer-merge-plugin",
"version": "v2.0.1", "version": "v2.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/wikimedia/composer-merge-plugin.git", "url": "https://github.com/wikimedia/composer-merge-plugin.git",
"reference": "8ca2ed8ab97c8ebce6b39d9943e9909bb4f18912" "reference": "a03d426c8e9fb2c9c569d9deeb31a083292788bc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/8ca2ed8ab97c8ebce6b39d9943e9909bb4f18912", "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/a03d426c8e9fb2c9c569d9deeb31a083292788bc",
"reference": "8ca2ed8ab97c8ebce6b39d9943e9909bb4f18912", "reference": "a03d426c8e9fb2c9c569d9deeb31a083292788bc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -539,9 +539,12 @@
}, },
"require-dev": { "require-dev": {
"composer/composer": "^1.1||^2.0", "composer/composer": "^1.1||^2.0",
"php-parallel-lint/php-parallel-lint": "~1.1.0", "ext-json": "*",
"mediawiki/mediawiki-phan-config": "0.11.1",
"php-parallel-lint/php-parallel-lint": "~1.3.1",
"phpspec/prophecy": "~1.15.0",
"phpunit/phpunit": "^8.5||^9.0", "phpunit/phpunit": "^8.5||^9.0",
"squizlabs/php_codesniffer": "~3.5.4" "squizlabs/php_codesniffer": "~3.7.1"
}, },
"type": "composer-plugin", "type": "composer-plugin",
"extra": { "extra": {
@ -568,9 +571,9 @@
"description": "Composer plugin to merge multiple composer.json files", "description": "Composer plugin to merge multiple composer.json files",
"support": { "support": {
"issues": "https://github.com/wikimedia/composer-merge-plugin/issues", "issues": "https://github.com/wikimedia/composer-merge-plugin/issues",
"source": "https://github.com/wikimedia/composer-merge-plugin/tree/v2.0.1" "source": "https://github.com/wikimedia/composer-merge-plugin/tree/v2.1.0"
}, },
"time": "2021-02-24T05:28:06+00:00" "time": "2023-04-15T19:07:00+00:00"
}, },
{ {
"name": "wp-oop/wordpress-interface", "name": "wp-oop/wordpress-interface",
@ -1712,6 +1715,71 @@
}, },
"time": "2020-07-09T08:09:16+00:00" "time": "2020-07-09T08:09:16+00:00"
}, },
{
"name": "inpsyde/composer-assets-compiler",
"version": "2.5.2",
"source": {
"type": "git",
"url": "https://github.com/inpsyde/composer-asset-compiler.git",
"reference": "26a4062c2171ac09492e684eb3e4462ec69cf3a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/inpsyde/composer-asset-compiler/zipball/26a4062c2171ac09492e684eb3e4462ec69cf3a6",
"reference": "26a4062c2171ac09492e684eb3e4462ec69cf3a6",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1 || ^2",
"ext-json": "*",
"php": ">= 7.2"
},
"require-dev": {
"composer/composer": "^2.1.9",
"inpsyde/php-coding-standards": "^1@dev",
"mikey179/vfsstream": "^1.6.10",
"mockery/mockery": "^1.3.5",
"phpunit/phpunit": "^8.5.21",
"vimeo/psalm": ">=4.11.2@stable"
},
"type": "composer-plugin",
"extra": {
"class": "Inpsyde\\AssetsCompiler\\Composer\\Plugin",
"branch-alias": {
"dev-master": "2.x-dev",
"dev-v1.x": "1.x-dev",
"dev-v2.x": "2.x-dev",
"dev-v3.x": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Inpsyde\\AssetsCompiler\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Inpsyde GmbH",
"email": "hello@inpsyde.com",
"homepage": "https://inpsyde.com/",
"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.5.2"
},
"time": "2022-03-07T13:50:29+00:00"
},
{ {
"name": "mockery/mockery", "name": "mockery/mockery",
"version": "1.3.6", "version": "1.3.6",
@ -1842,16 +1910,16 @@
}, },
{ {
"name": "netresearch/jsonmapper", "name": "netresearch/jsonmapper",
"version": "v4.1.0", "version": "v4.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cweiske/jsonmapper.git", "url": "https://github.com/cweiske/jsonmapper.git",
"reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" "reference": "f60565f8c0566a31acf06884cdaa591867ecc956"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956",
"reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", "reference": "f60565f8c0566a31acf06884cdaa591867ecc956",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1887,22 +1955,22 @@
"support": { "support": {
"email": "cweiske@cweiske.de", "email": "cweiske@cweiske.de",
"issues": "https://github.com/cweiske/jsonmapper/issues", "issues": "https://github.com/cweiske/jsonmapper/issues",
"source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0"
}, },
"time": "2022-12-08T20:46:14+00:00" "time": "2023-04-09T17:37:40+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v4.15.4", "version": "v4.17.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
"reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1943,9 +2011,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1"
}, },
"time": "2023-03-05T19:49:14+00:00" "time": "2023-08-13T19:53:39+00:00"
}, },
{ {
"name": "openlss/lib-array2xml", "name": "openlss/lib-array2xml",
@ -2157,27 +2225,25 @@
}, },
{ {
"name": "php-stubs/wordpress-stubs", "name": "php-stubs/wordpress-stubs",
"version": "v5.9.5", "version": "v5.9.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-stubs/wordpress-stubs.git", "url": "https://github.com/php-stubs/wordpress-stubs.git",
"reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717" "reference": "6a18d938d0aef39d091505a4a35b025fb6c10098"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/13ecf204a7e6d215a7c0d23e2aa27940fe617717", "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6a18d938d0aef39d091505a4a35b025fb6c10098",
"reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717", "reference": "6a18d938d0aef39d091505a4a35b025fb6c10098",
"shasum": "" "shasum": ""
}, },
"replace": {
"giacocorsiglia/wordpress-stubs": "*"
},
"require-dev": { "require-dev": {
"nikic/php-parser": "< 4.12.0", "nikic/php-parser": "< 4.12.0",
"php": "~7.3 || ~8.0", "php": "~7.3 || ~8.0",
"php-stubs/generator": "^0.8.1", "php-stubs/generator": "^0.8.3",
"phpdocumentor/reflection-docblock": "^5.3", "phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpstan": "^1.2" "phpstan/phpstan": "^1.10.12",
"phpunit/phpunit": "^9.5"
}, },
"suggest": { "suggest": {
"paragonie/sodium_compat": "Pure PHP implementation of libsodium", "paragonie/sodium_compat": "Pure PHP implementation of libsodium",
@ -2198,9 +2264,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-stubs/wordpress-stubs/issues", "issues": "https://github.com/php-stubs/wordpress-stubs/issues",
"source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.5" "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.6"
}, },
"time": "2022-11-09T05:32:14+00:00" "time": "2023-05-18T04:34:27+00:00"
}, },
{ {
"name": "phpcompatibility/php-compatibility", "name": "phpcompatibility/php-compatibility",
@ -3136,16 +3202,16 @@
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
"version": "3.0.3", "version": "3.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6296a0c086dd0117c1b78b059374d7fcbe7545ae",
"reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3190,7 +3256,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/diff/issues", "issues": "https://github.com/sebastianbergmann/diff/issues",
"source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" "source": "https://github.com/sebastianbergmann/diff/tree/3.0.4"
}, },
"funding": [ "funding": [
{ {
@ -3198,7 +3264,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-11-30T07:59:04+00:00" "time": "2023-05-07T05:30:20+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
@ -3342,16 +3408,16 @@
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
"version": "3.0.2", "version": "3.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git", "url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921" "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921", "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/66783ce213de415b451b904bfef9dda0cf9aeae0",
"reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921", "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3394,7 +3460,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues", "issues": "https://github.com/sebastianbergmann/global-state/issues",
"source": "https://github.com/sebastianbergmann/global-state/tree/3.0.2" "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.3"
}, },
"funding": [ "funding": [
{ {
@ -3402,7 +3468,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-02-10T06:55:38+00:00" "time": "2023-08-02T09:23:32+00:00"
}, },
{ {
"name": "sebastian/object-enumerator", "name": "sebastian/object-enumerator",
@ -3793,16 +3859,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v5.4.21", "version": "v5.4.26",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", "url": "https://api.github.com/repos/symfony/console/zipball/b504a3d266ad2bb632f196c0936ef2af5ff6e273",
"reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3867,12 +3933,12 @@
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"keywords": [ "keywords": [
"cli", "cli",
"command line", "command-line",
"console", "console",
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v5.4.21" "source": "https://github.com/symfony/console/tree/v5.4.26"
}, },
"funding": [ "funding": [
{ {
@ -3888,7 +3954,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-25T16:59:41+00:00" "time": "2023-07-19T20:11:33+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@ -4451,16 +4517,16 @@
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v5.4.21", "version": "v5.4.26",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f" "reference": "1181fe9270e373537475e826873b5867b863883c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/edac10d167b78b1d90f46a80320d632de0bd9f2f", "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c",
"reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f", "reference": "1181fe9270e373537475e826873b5867b863883c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4517,7 +4583,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v5.4.21" "source": "https://github.com/symfony/string/tree/v5.4.26"
}, },
"funding": [ "funding": [
{ {
@ -4533,7 +4599,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-22T08:00:55+00:00" "time": "2023-06-28T12:46:07+00:00"
}, },
{ {
"name": "theseer/tokenizer", "name": "theseer/tokenizer",

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}

View file

@ -0,0 +1,5 @@
{
"dependencies": "install",
"script": "build",
"commands": "yarn"
}