Skip to content

Decouple editions from core #155

@aleksip

Description

@aleksip
Member

Moved from #154:

Drop all code from all the different edition repos, decoupling them from patternlab-php-core.

Currently all editions have identical code for the console launcher, server router and Composer scripts. They are hard to maintain, especially if we want to be able to make changes required by #154. Without this code, the editions would basically consist of a single composer.json file. How could that not be nice! :)

The launcher and and router should be easy to move to patternlab-php-core, but moving out the Composer script code is a bit trickier. Moving it to core causes ugly looking Composer warnings when the first dependencies are installed, because the script code is not yet available to Composer.

However, I thought I had a great idea to move that code to a new Composer plugin ("pattern-lab/composer-plugin"). And it seems that it would work just fine, if not for a possible Composer bug. I opened an issue (composer/composer#6803) about it, let's see what happens. One especially nice thing about using a Composer plugin would be not having to have all those script entries in composer.json, making the single composer.json files even more zen-like!

Update:

I have now pushed feature/decoupled-core branches to edition-php-twig-development and patternlab-php-core. Seems to work nicely!

The new Composer plugin is under my GitHub account until a repo is created under the PL organization. I don't have privileges to do that, and maybe also best to wait until learn more about the Composer issue. That is, the plugin currently only works with Composer < 1.5.0.

Activity

self-assigned this
on Nov 20, 2017
aleksip

aleksip commented on Dec 12, 2017

@aleksip
MemberAuthor

@EvanLovely @sghoweri It seems that the development edition inline alias for core was causing the problem with Composer, and adding an alias for the plugin fixed it. Could you verify if feature/decoupled-core works for you? And if you have the possibility to test on Windows that would be great too.

aleksip

aleksip commented on Dec 12, 2017

@aleksip
MemberAuthor

Oh well, looks like adding an alias for the plugin didn't fix it after all. Only removing the alias for core seems to work. So it seems that this is a problem only for the development editions with the new alias model. Let's see if this new info helps the Composer folks to identify the cause.

aleksip

aleksip commented on Dec 14, 2017

@aleksip
MemberAuthor

I've now managed to work around the Composer issue by (temporarily) removing the core version constraint from the plugin. Now the plugin seems to work with "pattern-lab/core": "dev-feature/decoupled-core as 2.8.11" in the development edition's composer.json!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @aleksip

      Issue actions

        Decouple editions from core · Issue #155 · pattern-lab/patternlab-php-core