ux icon indicating copy to clipboard operation
ux copied to clipboard

Prevent updates to package.json

Open trsteel88 opened this issue 1 year ago • 9 comments
trafficstars

I am including symfony/ux-turbo in my application and it keeps trying to include a file in my package.json.

I don't want to include this in my package.json as I am including turbo myself. Is there a way to prevent changes to packages.json from specific bundles?

trsteel88 avatar Jun 12 '24 07:06 trsteel88

What file? The @symfony/ux-turbo/... one ?

smnandre avatar Jun 12 '24 14:06 smnandre

Yes, that's right.

trsteel88 avatar Jun 12 '24 22:06 trsteel88

Those files are the ones connecting Symfony with Turbo... what would you remove them ?

smnandre avatar Jun 12 '24 23:06 smnandre

I already have turbo included in my package.json

"@hotwired/turbo": "^7.1.0",

Why would I need the ux/turbo package? The only real reason that I am using symfony/ux-turbo is for the stream format helper. e.g:

if (TurboBundle::STREAM_FORMAT !== $request->getPreferredFormat(TurboBundle::STREAM_FORMAT)) {
    ...
}

trsteel88 avatar Jun 13 '24 02:06 trsteel88

The package would not install Turbo twice, so i am not sure to understand the problem here.

Why would I need the ux/turbo package?

Because you installed the symfony/ux-turbo bundle? :) The bundle goal is to connect webpack or assetmapper with symfony and ease the installation & usage of Turbo.

More information about the @symfony/ux-turbo/ package (it does not contain Turbo): https://symfony.com/doc/4.x/frontend/ux.html#how-does-symfony-ux-work

smnandre avatar Jun 14 '24 01:06 smnandre

Yes but I still don't want it to change my package.json. Is there a way to prevent that? I only want to use this bundle to detect the request type.

trsteel88 avatar Jun 14 '24 11:06 trsteel88

If you disable Flex probably ?

smnandre avatar Jun 14 '24 11:06 smnandre

I can't do that. I guess I'll just have to reset package.json whenever an update occurs. It's a shame it can't be configured as I'm not using this package for loading turbo, I just want it to detect the request type

trsteel88 avatar Jun 14 '24 11:06 trsteel88

Well, if having another dependency installed (even if not called) is impossible for you, yes i think this should be the only solution right now.

If you have another idea / implementation suggestion, we'd be glad to help you open a PR

smnandre avatar Jun 14 '24 14:06 smnandre

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Dec 15 '24 12:12 carsonbot

Friendly ping? Should this still be open? I will close if I don't hear anything.

carsonbot avatar Dec 29 '24 12:12 carsonbot

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

carsonbot avatar Jan 12 '25 12:01 carsonbot

perhaps see https://github.com/symfony/flex/pull/1032 cc @smnandre

94noni avatar Feb 07 '25 20:02 94noni

Good catch @94noni !

Closing here, as if something can be done, it will indeed be done on flex side.

smnandre avatar Feb 07 '25 23:02 smnandre