modman icon indicating copy to clipboard operation
modman copied to clipboard

Feature request: common path prefix

Open nevvermind opened this issue 9 years ago • 4 comments

When creating modules, we usually put all its files under src, because we may have some tests, unrelated files in the repo etc. and we want to keep them separated. But we want to keep the modman file at the repo's top level as well. So we end up mirroring the folder structure except the src part, which we always have to append.

Would it be difficult (and I mean BC breaks here) to add a common source folder once and the bash script prepends it on every subsequent source path? For exampled, instead of

src/app/code/community/MX/*          app/code/community/MX/
src/app/etc/modules/MX_Module1.xml   app/etc/modules/

... we could use this type of declaration (without mentioning the target path):

#[source="src/"]
app/code/community/MX/
app/etc/modules/

Like a dynamic CHDIR.

PS: The comment-syntax is completely bogus. No idea what syntactic constraints are there.

nevvermind avatar May 21 '15 15:05 nevvermind

Makes sense, but currently modman syntax is more or less working with composer and this new feature would break the compatibility with composer.. Not a huge issue really but it would add confusion for some people when they are using an old version and their modman files suddenly don't work. Also more documentation needed to explain the feature, etc.. So I personally would rather keep it simple/compatible and have slightly more verbose modman files. Would like to hear more people's opinions though.

One alternative (also not composer compatible but at least is already supported) is to have the root modman file like this:

@import src/

And then another modman file inside of src/:

app/code/community/MX/
app/etc/modules/

colinmollenhour avatar May 21 '15 16:05 colinmollenhour

What about a system variable setting this and modman checks for that? That would mean it's system wide but at least it's something

On 21 May 2015, at 18:30, Colin Mollenhour [email protected] wrote:

Makes sense, but currently modman syntax is more or less working with composer and this new feature would break the compatibility with composer.. Not a huge issue really but it would add confusion for some people when they are using an old version and their modman files suddenly don't work. Also more documentation needed to explain the feature, etc.. So I personally would rather keep it simple/compatible and have slightly more verbose modman files. Would like to hear more people's opinions though.

One alternative (also not composer compatible but at least is already supported) is to have the root modman file like this:

@import src/ And then another modman file inside of src/:

app/code/community/MX/ app/etc/modules/ — Reply to this email directly or view it on GitHub.

riconeitzel avatar May 21 '15 17:05 riconeitzel

@riconeitzel - It needn't be system-wide. It can be process-specific as well: MODMAN_SRC=./src sh modman deploy. Although I'm a little reluctant to use an env var because of the magic it brings, it's an option.

nevvermind avatar May 21 '15 17:05 nevvermind

Using system variables would make distribution a nightmare. I think "modman clone X" should be all that is ever required to deploy a module. Also this has the same problems regarding compatibility with composer. So the original proposal is not a bad one, just wanted to offer an alternative that already is possible to use without adding more features that composer will not support.

colinmollenhour avatar May 21 '15 20:05 colinmollenhour