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

Composer post create project commands fail on Windows #1242

Open
damsfx opened this issue Oct 30, 2024 · 7 comments
Open

Composer post create project commands fail on Windows #1242

damsfx opened this issue Oct 30, 2024 · 7 comments
Labels
needs pr Issues that are awaiting a PR to be submitted

Comments

@damsfx
Copy link
Contributor

damsfx commented Oct 30, 2024

Winter CMS Build

dev-develop

PHP Version

8.1

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

Related

The new composer post commands on Windows are done with all default values.

My tests are running the following on both Windows and Windows Subsystem Linux:

wintercms/winter (dev-develop 5f53526)
winter/storm (dev-develop a37c1f9)
winter/wn-backend-module (dev-develop e11d279)
winter/wn-cms-module (dev-develop 3ba7bcf)
winter/wn-system-module (dev-develop 9ac3b57)
  • Windows = ❌ the command php artisan winter:install is executed without user interaction.
  • WSL = ✅ All went well

Steps to replicate

On a Windows system, simply run composer create-project wintercms/winter example.com "dev-develop"

Workaround

No response

@bennothommo bennothommo added the needs review Issues/PRs that require a review from a maintainer label Oct 31, 2024
@nialma
Copy link

nialma commented Oct 31, 2024

It works on my windows system as the old composer-installation and like the the documentaion.
When composer create-project wintercms/winter . "dev-develop" is done ypu can run winter:install and all works as know (select, database, etc)

@bennothommo
Copy link
Member

@damsfx @nialma according to this - composer/composer#11709 (comment) - it won't be doable for php artisan winter:install to work on Windows as part of the post-create-project scripts.

Instead of @nialma's suggestion of rolling back the post-create-project-cmd changes in #1243, I wonder if we could opt instead to change it so it can bootstrap Winter non-interactively. Ideally, we can follow similar steps to what our devcontainer bootstrap script does, namely:

  • Run php artisan winter:env
  • Run php artisan key:generate
  • Create an empty database.sqlite file in the storage folder
  • Update .env and set DB_CONNECTION as sqlite and DB_DATABASE as storage/database.sqlite
  • Run php artisan migrate
  • Run php artisan winter:mirror public/

This would get the environment set up in a way that it could be run immediately.

Any thoughts on the above? (/cc @LukeTowers)

@bennothommo bennothommo added needs pr Issues that are awaiting a PR to be submitted and removed needs review Issues/PRs that require a review from a maintainer labels Oct 31, 2024
@nialma
Copy link

nialma commented Oct 31, 2024

@bennothommo

just did this for myself because I work with Windows and there is currently an error. With the "step back" in Composer I'm back to the "old" installation - if there's an easier way, I don't mind - it works fine for me under Windows....

Your idea is good, but not everyone works with SQLite... they should

  1. a query of the DB can be installed
  2. DB name can be queried etc...
    The current installation mode is really good

@damsfx i work also and at the moment only with windows an php artisan winter:install does ask me anything as the "old" versions with the "step back" in the composer.js

@bennothommo
Copy link
Member

@nialma You're right, not everyone uses SQLite, but the intention is to make it so that composer create-project wintercms/winter can be used to basically get started with a Winter project immediately and then, if necessary, the user can modify the configuration / .env file to suit their environment.

You can see that Laravel does exactly the same thing when someone runs composer create-project laravel/laravel.

@nialma
Copy link

nialma commented Oct 31, 2024

@bennothommo that sounds plausible and good....

You can see that Laravel does exactly the same thing when someone runs composer create-project laravel/laravel.

and that is the reason why i use for a laravel-project a downloaded version and make it manual and not with composer...... local i use laragon with marianDB/mySQL php 8.2.24

@damsfx
Copy link
Contributor Author

damsfx commented Oct 31, 2024

@bennothommo @nialma For myself, I use both MariaDB and SQLite databases, depending on the needs of the project.

Aligning with Laravel's choices doesn't worry me, as long as it allows new users to have a project up and running in a single command line.
Then, for those who want other settings, there's nothing to stop them running a php artisan winter:install --force command, right?

In my opinion, the more WinterCMS is aligned with Laravel, the better! Povilas' experience in testing Laravel-based CMS fits in with this idea.

@LukeTowers
Copy link
Member

@bennothommo I'm game with your proposed flow, could we perhaps have the final step be outputting to the console instructions for running winter:install --force to make it easier to guide people to use the CLI installer if they've just created a new project so that they can go through the flow to set the other values handled by that process (user etc)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs pr Issues that are awaiting a PR to be submitted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants