idleberg / php-wordpress-vite-assets

Injects assets from a Vite manifest to the Wordpress head, supports themes and plugins
https://packagist.org/packages/idleberg/wordpress-vite-assets
MIT License
133 stars 12 forks source link

New name #12

Closed szepeviktor closed 1 year ago

szepeviktor commented 1 year ago

Please consider a new name.

php-wordpress-vite-assets -> vite-assets-for-wordpress Idleberg\WordpressViteAssets\WordpressViteAssets -> Idleberg\WordPress\ViteAssets\Assets

What do you think?

szepeviktor commented 1 year ago

Similarly Idleberg\ViteManifest\ViteManifest -> Idleberg\ViteManifest\Manifest

idleberg commented 1 year ago

I'm open to arguments about why I should do this.

szepeviktor commented 1 year ago

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".

szepeviktor commented 1 year ago

As for the namespace, https://www.php-fig.org/ and Composer recommend VendorName\PackageName. For WordPress I recommend a third level: VendorName\WordPress\PackageName

idleberg commented 1 year ago

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.

idleberg commented 1 year ago

Could you please also commit the suggested changes for the namespace?

szepeviktor commented 1 year ago

Done 🍏

idleberg commented 1 year ago

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.)

szepeviktor commented 1 year ago

Does the Wordpress fraction suggest that it's a WordPress plugin

No. WordPress part of the namespace suggests this package is for WordPress.

szepeviktor commented 1 year ago

Filename fixed!

idleberg commented 1 year ago

The tests also need to be updated using the new namespace

szepeviktor commented 1 year ago

It was done in the second commit.

szepeviktor commented 1 year ago

Nice cooperation.