Closed szepeviktor closed 1 year ago
Similarly
Idleberg\ViteManifest\ViteManifest
-> Idleberg\ViteManifest\Manifest
I'm open to arguments about why I should do this.
I'm open to arguments about why I should do this.
Thank you for being open to this. I see you are into JavaScript/TypeScript, so these 2 PHP packages are having "php-" prefix. In PHP package world (Packagist) packages don't have "php" in their name. In WordPress world packages beginning with "wordpress" are not accepted to WP Plugins Directory. Because they are not authored by WordPress core contributors/Automattic.
So we end up being called vite-assets-for-wordpress
💡 It is very highly popular to start the name of a plugin with "wordpress".
As for the namespace, https://www.php-fig.org/ and Composer recommend VendorName\PackageName
.
For WordPress I recommend a third level: VendorName\WordPress\PackageName
As for the repository name, I prefer this system to keep my many projects in order, it helps when something is available for multiple languages or platforms. The package name (as defined in a manifest) is usually different from that.
It's true that I have very little experience when it comes to namespacing in PHP. The scheme I used was borrowed from patterns I came across from a user-perspective. But that doesn't mean, I copied the correct way. Allow me a few days to read myself into the matter.
Could you please also commit the suggested changes for the namespace?
Done 🍏
I have one question regarding the namespace. Does the Wordpress
fraction suggest that it's a WordPress plugin. Just to be on the safe side, because it's not (as you probably know.)
Does the
Wordpress
fraction suggest that it's a WordPress plugin
No. WordPress
part of the namespace suggests this package is for WordPress.
Filename fixed!
The tests also need to be updated using the new namespace
It was done in the second commit.
Nice cooperation.
Please consider a new name.
php-wordpress-vite-assets
->vite-assets-for-wordpress
Idleberg\WordpressViteAssets\WordpressViteAssets
->Idleberg\WordPress\ViteAssets\Assets
What do you think?