UserFrosting icon indicating copy to clipboard operation
UserFrosting copied to clipboard

Add vendor name to sprinkles system

Open lcharette opened this issue 8 years ago • 10 comments

Sprinkles should use the vendor/sprinkleName convention to avoid naming conflict long term. Will avoid nasty conflicts when dealing with community sprinkles.

lcharette avatar Dec 16 '17 19:12 lcharette

I made some changes to assets-install.js in order todo this for my theme sprinkle (AdminLTE v4 repo here)

In my sprinkle I update all the javascript libraries and it's simply not compiles with the existing in core sprinkle.. so I made this

assets-install.zip

mgpro94 avatar Apr 19 '20 07:04 mgpro94

Difficult to be sure over such a long span of time, but I believe this ticket predates the introduction of unified npm and bower dependencies (important as duplicates can result on strange bugs, particularly if versions are mixed).

@lcharette What exactly is the intent here? Is it related to vendor packages, or protecting sprinkle assets from collision accidental?

Silic0nS0ldier avatar Apr 21 '20 07:04 Silic0nS0ldier

@Silic0nS0ldier

In my case.. I needed to clean the package.json of the core sprinkle to be able to add bootstarp 4 (for AdminLTE Theme).

This means the a sprinkle developer can't add any npm package that conflict with the core

mgpro94 avatar Apr 21 '20 07:04 mgpro94

Yeah, that was a deliberate change and a noted risk. Bower lets you specify a "resolution" to resolve these conflicts. npm unfortunately doesn't offer an alternative. https://github.com/userfrosting/merge-package-dependencies is in need of some TLC, I'll take your scenario on board and see if I can figure out a way to satisfy your scenario without deviating from the spec. Adding support for package aliases will likely provide the outcome you are after as it'll let you install a copy of a dependency under a different name.

Silic0nS0ldier avatar Apr 21 '20 07:04 Silic0nS0ldier

I've opened a ticket https://github.com/userfrosting/merge-package-dependencies/issues/14

Silic0nS0ldier avatar Apr 21 '20 07:04 Silic0nS0ldier

Package aliases can be great solution..

But.. what about package dependencies? In order to install bootstrap 4 I needed to add popper.js.. If I add a alias to popper.js, the bootstrap will still be able to install?

(I am asking because I really don't now how the npm aliases works)

mgpro94 avatar Apr 21 '20 08:04 mgpro94

An aliased package will still have its dependencies installed. As for if they too need to have conflicts resolved, I'm not sure. Its a scenario I've not had the misfortune of coming across as of yet.

Silic0nS0ldier avatar Apr 21 '20 08:04 Silic0nS0ldier

This is the list of packages in order to install AdminLTE v3

Can you try to test them when you finish your work on marge-package-dependencies?

btw.. I can help with testing or rewriting if needed

mgpro94 avatar Apr 21 '20 08:04 mgpro94

@lcharette What exactly is the intent here? Is it related to vendor packages, or protecting sprinkle assets from collision accidental?

This ticket is for full blown Sprinkles. Currently Me/Foo and You/Foo can't coexist in our  sprinkles.json. Nothing to do with assets.

lcharette avatar Apr 21 '20 12:04 lcharette

Ah, so the composer vendor name. That makes a lot more sense.

Silic0nS0ldier avatar Apr 22 '20 01:04 Silic0nS0ldier

Not relevant with UF5 anymore

lcharette avatar Nov 25 '23 02:11 lcharette