Skip to content
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

🔨 chore: Update Appsero and refactor with Mozart #55

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 38 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,62 @@
}
],
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"WeDevs_WC_Conversion_Tracking\\Dependencies\\": "dependencies/"
}
},
"require": {
"php": ">=7.0",
"composer/installers": "^1.9",
"appsero/client": "^2.0"
"appsero/client": "^2.0.4"
},

"require-dev": {
"automattic/vipwpcs": "^2.3",
"coenjacobs/mozart": "^0.7.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7"
},
"scripts": {
"phpcs": [
"phpcs -p -s"
],
"post-install-cmd": [
"[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
"composer dump-autoload"
],
"post-update-cmd": [
"[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
"composer dump-autoload"
Comment on lines +34 to +39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Correct script syntax for Composer hooks

In the post-install-cmd and post-update-cmd scripts, the conditional statements may not execute as intended within Composer's script context.

Consider revising the scripts to ensure they function correctly. Composer scripts don't interpret shell conditionals natively.

Apply this diff:

"post-install-cmd": [
-    "[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
+    "@php vendor/bin/mozart compose",
     "composer dump-autoload"
],
"post-update-cmd": [
-    "[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
+    "@php vendor/bin/mozart compose",
    "composer dump-autoload"
]

Alternatively, if you want the script to run only in dev mode, use Composer's scripts-dev section or check the COMPOSER_DEV_MODE environment variable within a PHP script.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
"composer dump-autoload"
],
"post-update-cmd": [
"[ $COMPOSER_DEV_MODE -eq 0 ] || \"vendor/bin/mozart\" compose",
"composer dump-autoload"
"@php vendor/bin/mozart compose",
"composer dump-autoload"
],
"post-update-cmd": [
"@php vendor/bin/mozart compose",
"composer dump-autoload"

]
},
"config": {
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"extra": {
"mozart": {
"dep_namespace": "WeDevs_WC_Conversion_Tracking\\Dependencies\\",
"dep_directory": "/dependencies/",
"classmap_directory": "/dependencies/classes/",
"classmap_prefix": "WeDevs_WC_Conversion_Tracking_",
"packages": [
"appsero/updater",
"appsero/client"
],
"excluded_packages": [
"psr/container"
],
"override_autoload": {
"google/apiclient": {
"classmap": [
"src/"
]
}
},
"delete_vendor_directories": true
}
}
}
Loading