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

Remove publishing of public assets #5619

Merged

Conversation

dimer47
Copy link
Contributor

@dimer47 dimer47 commented Aug 16, 2024

The commit removes the automatic publishing of Backpack's public assets during the backpack:install -q -n command. This change ensures that asset deployment is only handled by the backpack:publish-header-metas command, as intended. See #5552 (comment)

WHY

BEFORE - What was wrong? What was happening before this PR?

Previously, when running the backpack:install -q -n command, public assets were automatically deployed to the public/ directory, even though this was not desired. This behavior led to unnecessary asset installation during the general installation process, which was redundant and could cause conflicts with other commands like backpack:publish-header-metas.

AFTER - What is happening after this PR?

After this PR, the backpack:install -q -n command no longer deploys public assets by default. The responsibility for asset deployment now lies solely with the backpack:publish-header-metas command, giving developers more control over when and where assets are deployed.

HOW

How did you achieve that, in technical terms?

I removed the logic responsible for publishing the public assets from the backpack:install command in the BackpackServiceProvider class. This ensures that assets are no longer automatically published during the installation process.

Is it a breaking change?

No, this is not a breaking change. The change simply prevents unwanted asset deployment during the installation process. The backpack:publish-header-metas command should be used for asset deployment instead.

How can we test the before & after?

To test before the PR:

  1. Run the php artisan backpack:install -q -n command.
  2. Check the public/ directory and observe that public assets are automatically installed.

To test after the PR:

  1. Run the php artisan backpack:install -q -n command.
  2. Check the public/ directory and confirm that no assets are installed.
  3. Run the php artisan backpack:publish-header-metas command.
  4. Confirm that the assets are correctly deployed to the public/ directory.

--
cc @pxpm

The commit removes the publishing of Backpack's public assets from the `publishFiles` method in the `BackpackServiceProvider` class. This change prevent double assets publishing with backpack:publish-header-metas` command.
@jcastroa87
Copy link
Member

Hello @dimer47

Thanks for the PR, @pxpm will check and if everything is ok will be merge.

Cheers.

@pxpm
Copy link
Contributor

pxpm commented Aug 19, 2024

Lovelly! Thanks @dimer47 for reporting the issue and providing the PR 🙏

@pxpm pxpm merged commit 3414754 into Laravel-Backpack:main Aug 19, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants