robsontenorio / mary

Laravel Blade UI Components for Livewire 3
https://mary-ui.com
Other
1.03k stars 125 forks source link

MaryUI messes up new installation of jetstream #382

Closed ArashDevelops closed 6 months ago

ArashDevelops commented 6 months ago

maryUI version

1.26

daisyUI version

4.10.2

Livewire version

3.4

What browsers are affected?

Firefox, Chrome, Safari, Microsoft Edge

What happened?

After fresh installation of jetstream and then adding mary ui, my app is broken. some files are affected that was not the case two weeks ago when I tried mary-ui. I also don't have mary components in my views directory. what changed. I didn't find any new information on the doc. / Screenshot 2024-04-18 at 6 01 25 PM and also there is no guide for manual installaion on the docs now.

robsontenorio commented 6 months ago

How looks like your config/mary.php?

ArashDevelops commented 6 months ago

I have "mary-" prefix there. but no mary directory inside my views. what mary did is this: inside my components I have layout directory and inside there is a app.blade.php and there is a livewire folder with welcome.blade.php in it it also changed my web.php routing file which was not the case before.

robsontenorio commented 6 months ago

How looks like your config/mary.php, package.json and composer.json?

ArashDevelops commented 6 months ago

as of composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "laravel/framework": "^11.0",
        "laravel/jetstream": "^5.0",
        "laravel/sanctum": "^4.0",
        "laravel/tinker": "^2.9",
        "livewire/livewire": "^3.4",
        "robsontenorio/mary": "^1.26"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "pestphp/pest": "^2.0",
        "pestphp/pest-plugin-laravel": "^2.0",
        "spatie/laravel-ignition": "^2.4"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}

package.json

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.7",
        "@tailwindcss/typography": "^0.5.10",
        "autoprefixer": "^10.4.19",
        "axios": "^1.6.4",
        "daisyui": "^4.10.2",
        "laravel-vite-plugin": "^1.0",
        "postcss": "^8.4.38",
        "tailwindcss": "^3.4.3",
        "vite": "^5.0"
    }
}

and for mary

<?php

return [
    /**
     * Default is empty.
     *    prefix => ''
     *              <x-button />
     *              <x-card />
     *
     * Renaming all components:
     *    prefix => 'mary-'
     *               <x-mary-button />
     *               <x-mary-card />
     *
     * Make sure to clear view cache after renaming
     *    php artisan view:clear
     *
     */
    'prefix' => 'mary-',

    /**
     * Components settings
     */
    'components' => [
        'spotlight' => [
            'class' => 'App\Support\Spotlight',
        ]
    ]
];
robsontenorio commented 6 months ago

I did a fresh install Laravel + Jetstream.

The only issue was about web.php . The installer should not replace the current file. If you revert it back it works. I will update the installer.

ArashDevelops commented 6 months ago

That was just one part of the problem. no views are published for mine. Are you using laravel 11 with the new file structure? and did you install jetstream with livewire? thanks.

robsontenorio commented 6 months ago

The installer will be smarter on Jetstream / Breeze detection.

ArashDevelops commented 6 months ago

I tried the installer today and it was fine in regard to not messing with the jetstream. But still no views are published from this package. Is this a new intended behavior? I really like to have that mary folder inside my views but so far it's not happening

robsontenorio commented 6 months ago

This is intended.

When Jetstream or Breeze is detected, no demo views will be published.

ArashDevelops commented 6 months ago

I was not talking about demo views. I am talking about the mary components itselves. I don't have them in my resources and so I can't costumize them. Is this also intended? thank you in advance.

robsontenorio commented 6 months ago

https://github.com/robsontenorio/mary/issues/179#issuecomment-1841661935

ArashDevelops commented 6 months ago

oh. I see . Thank you for creating this but this approach is not my style personally. I'm more of control freak and I want the files in my project, that way I no longer worry about any breaking changes to my project later on for example by upgrading the package.