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

Easy transition from composer-asset-plugin to foxy #8

Closed
schmunk42 opened this issue Sep 20, 2017 · 6 comments
Closed

Easy transition from composer-asset-plugin to foxy #8

schmunk42 opened this issue Sep 20, 2017 · 6 comments
Assignees
Milestone

Comments

@schmunk42
Copy link
Contributor

Could there be a functionality to support cap syntax? Like so...

  • convert npm- into entries in packages.json.
  • don't use them in composer solver
  • run composer installation
  • run foxy

Maybe even with a mapping for bower-Xyz.js to npm-xyz if needed. (optional)

@francoispluchino
Copy link
Member

Extracting the asset dependencies in a package.json file is not complicated in itself. However there are 2 important points that pose a problem:

  1. A conversion of the Composer to NPM versions must be done (therefore a possible risk of bug as for CAP)
  2. Bower is no longer supported, and is not supported in Foxy

For the first problem, we can make a converter, however I do not want to pollute Foxy with this code, so we could have an additional Composer plugin foxy/legacy or foxy/foxy-legacy. This plugin will require Foxy, and will perform the conversion via an event triggered by Foxy.

So to summarize:

  1. Add triggers in Foxy (use the Composer event system)
  2. Create the foxy-legacy plugin to create a package.json file for the NPM dependencies ; throw an exception if Bower packages are found ; and create a converter of range versions in opposition of CAP (Composer to NPM and not NPM to Composer)

PS. This is still not packages.json, but package.json ;-)

@francoispluchino
Copy link
Member

I also forgot, that the VCS repositories must be converted in the dependency versions in the package.json file. It's a lot of work for a halftone result (potential bugs and Bower isn't unsupported).

I can already add the triggers in Foxy, which will allow any other plugin to be created, if Foxy does not officially support it.

@francoispluchino
Copy link
Member

Foxy events are added by 3f16cd0.

@schmunk42
Copy link
Contributor Author

schmunk42 commented Sep 20, 2017

Wow, nice!

This issue can be closed then, please reopen if needed.

@francoispluchino
Copy link
Member

Removing NPM dependencies in Composer before the resolution by the Solver SAT may cause problems. I'll look if it's achievable.

@francoispluchino
Copy link
Member

It's not possible without a plugin installed in global mode, because the pre-dependencies-solving event is triggered only with the already installed plugins. And even with that, it will be difficult to remove the asset packages. A package mock must be created for each version required during the resolution, and installation operations must be removed after the resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants