Open Taimurian opened 1 month ago
Hi, thanks for reporting the issue. Unfortunately I don't have access to a Windows system to debug on currently. We will look into it asap
I can confirm this, Windows 10 is my OS, Composer version 2.7.2
We had a look into the issue and unfortunately the way we wanted to run the composer command after creating the project does not work in Windows. There's an open issue in the composer project and from what I read it's not solvable because of a limitation how Symfony/Process executes processes on windows https://github.com/composer/composer/issues/11709
We will remove the create:plugin
command from the post-create-project-cmd
hook.
The step composer create:plugin
then needs to be executed manually after the project has been created.
We had a look into the issue and unfortunately the way we wanted to run the composer command after creating the project does not work in Windows. There's an open issue in the composer project and from what I read it's not solvable because of a limitation how Symfony/Process executes processes on windows composer/composer#11709
We will remove the
create:plugin
command from thepost-create-project-cmd
hook. The stepcomposer create:plugin
then needs to be executed manually after the project has been created.
Hey Hendrik, I hope I'm understanding right. Basically the post-create-project-cmd isn't running, so post project creation I run create:plugin and that should do it... It's not working for me.
It asks all the questions, I filled everything in, it still isn't showing up in the plugin section of my admin panel on WP and I'm not seeing the files in the plg root that I would expect for a wordpress plugin. Actually, come to think of it, how does it know it's for Wordpress and not Joomla without me specifying that? With "task" there was differentiation.
@GenoPeppino did you run the setup-wordpress
task afterward? The create:plugin
command creates the files in the build
folder. To have them in the plugin root folder you need to run task setup-wordpress
to make the plugin available in WordPress.
https://github.com/yootheme/starter-plugin?tab=readme-ov-file#set-up-the-plugin
I get the following error when I run task setup-wordpress...
Script YOOtheme\Starter\TaskHelper::run handling the run:task event terminated with an exception
In Finder.php line 592:
The ".../test-three-ytp/wordpress/test_three_ytp" directory does not exist.
task: Failed to run task "setup-wordpress": exit status 1
@GenoPeppino
setup-wordpress
has two copy steps.
First it copies all *.php file from build/wordpress
to dist/wordpress
and replaces placeholders.
Then all files in dist/wordpress
are copied to the plugin root folder.
I'm not sure where the path ../test-three-ytp/wordpress/test_three_ytp
is could be coming from?
Are you on the latest version?
Please also ensure you are also using the latest starter-utils. The dependencies can be update with the composer update
command
@GenoPeppino
setup-wordpress
has two copy steps. First it copies all *.php file frombuild/wordpress
todist/wordpress
and replaces placeholders. Then all files indist/wordpress
are copied to the plugin root folder.I'm not sure where the path
../test-three-ytp/wordpress/test_three_ytp
is could be coming from? Are you on the latest version? Please also ensure you are also using the latest starter-utils. The dependencies can be update with thecomposer update
command
To the best of my understanding. composer update in the root didn't change anything.
Please note a mistake in the path I shared (accidentally removed dist). Mine is basically the same as the one in the initial question from @Taimurian
".../wp-content/plugins/my-plugin/dist/wordpress/my-plugin" directory does not exist.
Full error message:
task: [utils:copy] composer run:task -q -- copy '*.php' dist/wordpress/test_ninety_ytp Copied 0 files to 'dist/wordpress/test_ninety_ytp' task: [utils:placeholder] composer run:task -q -- placeholder dist/wordpress/test_ninety_ytp/test_ninety_ytp.php '{"AUTHOR":"None","AUTHOREMAIL":"none@poorup.com","AUTHORURL":"http://poorup.com","COPYRIGHT":"Copyright (C)","DATE":"2024-11-20","DESCRIPTION":"test ninety plugin description","LICENSE":"GNU General Public License","NAME":"test_ninety_ytp","PHPMINIMUM":"7.4","UPDATEHOST":"","UPDATEURI":"","VERSION":"0.0.1","WORDPRESSMINIMUM":"6.2"}' task: [utils:copy] composer run:task -q -- copy '**' ./ Script YOOtheme\Starter\TaskHelper::run handling the run:task event terminated with an exception
In Finder.php line 592:
The ".../wp-content/plugins/test-ninety-ytp/dist/wordpress/test_ninety_ytp" directory does not exist.
run:task [--dev] [--no-dev] [--] [
task: Failed to run task "setup-wordpress": exit status 1
task: [utils:copy] composer run:task -q -- copy '*.php' dist/wordpress/test_ninety_ytp Copied 0 files to 'dist/wordpress/test_ninety_ytp'
It looks like the plugin files weren't created in the build
folder?
After you run composer create:plugin
you should see the file structure like here: https://github.com/yootheme/starter-plugin?tab=readme-ov-file#create-a-new-plugin
task: [utils:copy] composer run:task -q -- copy '*.php' dist/wordpress/test_ninety_ytp Copied 0 files to 'dist/wordpress/test_ninety_ytp'
It looks like the plugin files weren't created in the
build
folder? After you runcomposer create:plugin
you should see the file structure like here: https://github.com/yootheme/starter-plugin?tab=readme-ov-file#create-a-new-plugin
That's not what I'm seeing. Here are the differences:
├── build
│ ├── joomla
│ ├── plugin.stub
│ ├── plugin.xml
│ ├── wordpress
│ ├── plugin.stub
│ └── Taskfile.yml
In this order I ran the following: composer create-project yootheme/starter-plugin test-ninety-ytp (no errors) navigate to new plugin root directory composer create:plugin (questions asked, questions answered) task setup-wordpress (error shown above)
While my error matches the first one reported, NOTE the difference: '{"AUTHOR":"None","AUTHOREMAIL":"none@poorup.com","AUTHORURL":"http://poorup.com","COPYRIGHT":"Copyright (C)","DATE":"2024-11-20","DESCRIPTION":"test ninety plugin description","LICENSE":"GNU General Public License","NAME":"test_ninety_ytp","PHPMINIMUM":"7.4","UPDATEHOST":"","UPDATEURI":"","VERSION":"0.0.1","WORDPRESSMINIMUM":"6.2"}'
This shows that Author, author URL, description, etc were all filled in during the create:plugin process. So it did run, and I didn't see any errors.
I encountered two issues while trying to use the Yootheme Starter Plugin:
setup-wordpress
task due to a missing directory.create-project
step, as stated in the documentation.Steps to reproduce
Issue 2: The following error occurs:
Expected behavior
composer create-project
command, I expected to be prompted for additional plugin metadata (title, description, author, etc.) as described in the documentation.setup-wordpress
task should complete successfully and copy the necessary plugin files from the build folder to the plugin root folder.Screenshots
Environment: